Skip to content

Commit

Permalink
Merge pull request #616 from RJPvT/patch-1
Browse files Browse the repository at this point in the history
fix: permissions error for LDAP login
  • Loading branch information
nikkothari22 authored Jan 12, 2024
2 parents a5f5db0 + 4b31243 commit 0fe375b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions raven/raven/doctype/raven_user/raven_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ def add_user_to_raven(doc,method):
if not doc.full_name:
raven_user.full_name = doc.first_name
raven_user.enabled = 1
raven_user.save()
raven_user.save(ignore_permissions=True)
else:
raven_user = frappe.get_doc("Raven User", {"user": doc.name})
if not doc.full_name:
raven_user.full_name = doc.first_name
raven_user.enabled = 0
raven_user.save()
raven_user.save(ignore_permissions=True)
else:
# Raven user does not exist. Check if the user is a system user.
if doc.user_type == "System User":
Expand All @@ -102,7 +102,7 @@ def add_user_to_raven(doc,method):
if not doc.full_name:
raven_user.full_name = doc.first_name
raven_user.enabled = 1
raven_user.insert()
raven_user.insert(ignore_permissions=True)
else:
if "Raven User" in [d.role for d in doc.get("roles")]:
# Create a Raven User record for the user.
Expand All @@ -111,4 +111,4 @@ def add_user_to_raven(doc,method):
if not doc.full_name:
raven_user.full_name = doc.first_name
raven_user.enabled = 1
raven_user.insert()
raven_user.insert(ignore_permissions=True)

0 comments on commit 0fe375b

Please sign in to comment.