fix(payment-request): do not set guest as administrator (#22803)

This commit is contained in:
Mangesh-Khairnar
2020-07-24 18:18:49 +05:30
committed by GitHub
parent 6a48988c76
commit af9e44f059

View File

@@ -140,9 +140,6 @@ class PaymentRequest(Document):
})
def set_as_paid(self):
if frappe.session.user == "Guest":
frappe.set_user("Administrator")
payment_entry = self.create_payment_entry()
self.make_invoice()
@@ -254,7 +251,7 @@ class PaymentRequest(Document):
if status in ["Authorized", "Completed"]:
redirect_to = None
self.run_method("set_as_paid")
self.set_as_paid()
# if shopping cart enabled and in session
if (shopping_cart_settings.enabled and hasattr(frappe.local, "session")