Merge branch 'develop' into razorpay-subscription
diff --git a/erpnext/non_profit/doctype/membership/membership.py b/erpnext/non_profit/doctype/membership/membership.py
index a523a23..a81bf30 100644
--- a/erpnext/non_profit/doctype/membership/membership.py
+++ b/erpnext/non_profit/doctype/membership/membership.py
@@ -62,11 +62,9 @@
 					'subscription_id': subscription_id,
 					'email_id': email
 				}, order_by="creation desc")
-
 	return frappe.get_doc("Member", members[0]['name'])
 
-
-@frappe.whitelist()
+@frappe.whitelist(allow_guest=True)
 def trigger_razorpay_subscription(data):
 	if isinstance(data, six.string_types):
 		data = json.loads(data)
@@ -88,10 +86,13 @@
 
 	if data.event == "subscription.activated":
 		member.customer_id = payment.customer_id
-		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)
+
+	# 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({