Browse Source

circular remove file size

master
venkataakhil 1 year ago
parent
commit
3a67c95a8a
  1. 1
      smart_service/add_ons/doctype/circular/circular.js
  2. 37
      smart_service/add_ons/doctype/circular/circular.py

1
smart_service/add_ons/doctype/circular/circular.js

@ -20,7 +20,6 @@ frappe.ui.form.on('Circular', {
name: frm.doc.name
},
callback: function (r) {
console.log(r.message, "r.message")
if (r.message && r.message[0] == false) {
frm.doc.circular_image = ""
frm.refresh_fields("circular_image")

37
smart_service/add_ons/doctype/circular/circular.py

@ -18,17 +18,34 @@ def file_validation(image, name):
res1 = check_png_ext(image)
res2 = check_pdf_ext(image)
if res == True or res1 == True or res2 == True:
width, height, size = details_of_image(image)
if width > 49 or height > 49 or size > 65 and image:
val = checking_image(image, "Circular",
"circular_image", name)
if val == True:
return False, 2
else:
return True
return True
else:
val = checking_image(image, "Circular",
"circular_image", name)
return False, 1
# if res== True:
# pass
# else:
# width, height, size = details_of_image(image)
# if width > 49 or height > 49 or size > 65 and image:
# val = checking_image(image, "Circular","circular_image", name)
# if val:
# return False, 2
# if res2 == True:
# pass
# else:
# width, height, size = details_of_image(image)
# if width > 49 or height > 49 or size > 65 and image:
# val = checking_image(image, "Circular",
# "circular_image", name)
# if val == True:
# return False, 2
# else:
# return True
# else:
# val = checking_image(image, "Circular",
# "circular_image", name)
if res == False:
ret = res
elif res1 == False:

Loading…
Cancel
Save