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

This commit is contained in:
Mangesh-Khairnar 2020-07-24 18:05:13 +05:30 committed by GitHub
parent a8efe8eb5f
commit 762f6297f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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