Merge pull request #21536 from scmmishra/rzpay-fixes
fix: elif block error
diff --git a/erpnext/non_profit/doctype/membership/membership.py b/erpnext/non_profit/doctype/membership/membership.py
index a81bf30..5a69cdb 100644
--- a/erpnext/non_profit/doctype/membership/membership.py
+++ b/erpnext/non_profit/doctype/membership/membership.py
@@ -86,13 +86,6 @@
if data.event == "subscription.activated":
member.customer_id = payment.customer_id
-
- # Update these values anyway
- member.subscription_start = datetime.fromtimestamp(subscription.start_at)
- member.subscription_end = datetime.fromtimestamp(subscription.end_at)
- member.subscription_activated = 1
- member.save(ignore_permissions=True)
-
elif data.event == "subscription.charged":
membership = frappe.new_doc("Membership")
membership.update({
@@ -109,6 +102,12 @@
})
membership.insert(ignore_permissions=True)
+ # Update these values anyway
+ member.subscription_start = datetime.fromtimestamp(subscription.start_at)
+ member.subscription_end = datetime.fromtimestamp(subscription.end_at)
+ member.subscription_activated = 1
+ member.save(ignore_permissions=True)
+
return True