fix(Opportunity): Don't assign to Guest (#17996)

If Opportunity is created from Website, it breaks because
the assign_to user is Guest
This commit is contained in:
Faris Ansari 2019-06-20 11:34:14 +05:30 committed by GitHub
parent 903d5201b4
commit 23f9b6156f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -342,7 +342,7 @@ def assign_to_user(doc, subject_field):
elif doc.lead:
assign_user = frappe.db.get_value('Lead', doc.lead, 'lead_owner')
if assign_user and assign_user != 'Administrator':
if assign_user and assign_user not in ['Administrator', 'Guest']:
if not assign_to.get(dict(doctype = doc.doctype, name = doc.name)):
assign_to.add({
"assign_to": assign_user,