From 3a67c95a8a800d47e9457c82bc5820ad993e149a Mon Sep 17 00:00:00 2001 From: venkataakhil Date: Wed, 28 Jun 2023 17:40:04 +0530 Subject: [PATCH] circular remove file size --- .../add_ons/doctype/circular/circular.js | 1 - .../add_ons/doctype/circular/circular.py | 37 ++++++++++++++----- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/smart_service/add_ons/doctype/circular/circular.js b/smart_service/add_ons/doctype/circular/circular.js index 94e1a82..f503a59 100644 --- a/smart_service/add_ons/doctype/circular/circular.js +++ b/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") diff --git a/smart_service/add_ons/doctype/circular/circular.py b/smart_service/add_ons/doctype/circular/circular.py index 73c29dc..b0cbbf5 100644 --- a/smart_service/add_ons/doctype/circular/circular.py +++ b/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: