From 6546892d135973780f1bb4eadd98256c54dee9ed Mon Sep 17 00:00:00 2001 From: Smit Vora Date: Thu, 31 Aug 2023 18:47:54 +0530 Subject: [PATCH 1/2] fix: don't validate if empty (cherry picked from commit 8d67f0b86eee4edc1722875f0518d9c278d28867) --- india_compliance/gst_india/doctype/gstin/gstin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/india_compliance/gst_india/doctype/gstin/gstin.py b/india_compliance/gst_india/doctype/gstin/gstin.py index bd8bd5899..93ce26140 100644 --- a/india_compliance/gst_india/doctype/gstin/gstin.py +++ b/india_compliance/gst_india/doctype/gstin/gstin.py @@ -54,6 +54,9 @@ def get_gstin_status(gstin, transaction_date=None, is_request_from_ui=0): """ Permission check not required as GSTIN details are public where GSTIN is known. """ + if not gstin: + return + if not is_status_refresh_required(gstin, transaction_date): if not frappe.db.exists("GSTIN", gstin): return From f9643718825e95419fecb8a2dff6d44489ea9186 Mon Sep 17 00:00:00 2001 From: Smit Vora Date: Thu, 31 Aug 2023 19:55:37 +0530 Subject: [PATCH 2/2] fix: don't return if enqueued (cherry picked from commit 4b4991fab6125fd71875b24c9f1577c988c5eea2) --- india_compliance/gst_india/doctype/gstin/gstin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/india_compliance/gst_india/doctype/gstin/gstin.py b/india_compliance/gst_india/doctype/gstin/gstin.py index 93ce26140..23bf887a3 100644 --- a/india_compliance/gst_india/doctype/gstin/gstin.py +++ b/india_compliance/gst_india/doctype/gstin/gstin.py @@ -70,7 +70,7 @@ def get_updated_gstin(gstin, transaction_date=None, is_request_from_ui=0): if is_request_from_ui: return create_or_update_gstin_status(gstin) - return frappe.enqueue( + frappe.enqueue( create_or_update_gstin_status, enqueue_after_commit=True, queue="short",