mirror of
https://github.com/retspen/webvirtcloud.git
synced 2026-04-26 16:05:58 +03:00
[GH-ISSUE #602] Cannot edit LDAP-user #352
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/webvirtcloud#352
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @thofram on GitHub (Sep 22, 2023).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/602
When I try to edit a user created by LDAP-logon, I get this error:
ERROR: Internal Server Error: /admin/users/2/update/
I cannot make this LDAP user an admin.
@thofram commented on GitHub (Sep 22, 2023):
From /srv/webvirtcloud/webvirtcloud.log:
[2023-09-22 15:26:33,112] ERROR: Internal Server Error: /admin/users/2/update/ Traceback (most recent call last): File "/srv/webvirtcloud/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/srv/webvirtcloud/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/webvirtcloud/admin/decorators.py", line 8, in _inner return function(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/webvirtcloud/admin/views.py", line 120, in user_update attributes = UserAttributes.objects.get(user=user) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/webvirtcloud/venv/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/webvirtcloud/venv/lib/python3.11/site-packages/django/db/models/query.py", line 637, in get raise self.model.DoesNotExist( accounts.models.UserAttributes.DoesNotExist: UserAttributes matching query does not exist.@catborise commented on GitHub (Sep 22, 2023):
@krejcar25 do you have any fix/recommendation. Thanks
@krejcar25 commented on GitHub (Sep 22, 2023):
will check tomorrow @catborise @thofram
@krejcar25 commented on GitHub (Sep 23, 2023):
this is caused by incorrect use of Django User models. developers are supposed to extend the builtin User model and add attributes this way (doc). the way it's implemented here is through a sidecar model which django-auth-ldap does not know it should create. i will try and find a workaround.
@thofram commented on GitHub (Sep 24, 2023):
Thank you, I can edit the userprofiles of LDAP-users now.