Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: permissions error for LDAP login #616

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading