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

Unknown error when trying to add first user #403

Open
johann-petrak opened this issue Mar 11, 2024 · 2 comments
Open

Unknown error when trying to add first user #403

johann-petrak opened this issue Mar 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@johann-petrak
Copy link

  • logged in as admin
  • clicked manage users
  • Filled out the fields for a new user and clicked "Save"
  • Got a pop up window in the browser saying: "Could not save user details""Unkown error: ServiceUser matching query does not exist"
  • Exception on the log
teamware02-backend-1    | 2024-03-11 13:27:48,220 backend.rpcserver INFO     Called login
teamware02-nginx-1      | 193.171.142.175 - - [11/Mar/2024:13:27:48 +0000] "POST /rpc/ HTTP/1.1" 200 142 "http://pflaume.ofai.at:8076/login" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0" "-"
teamware02-nginx-1      | 193.171.142.175 - - [11/Mar/2024:13:27:54 +0000] "GET /static/assets/ManageUsers-4f31f8ef.js HTTP/1.1" 200 7325 "http://pflaume.ofai.at:8076/" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0" "-"
teamware02-backend-1    | 2024-03-11 13:27:56,783 backend.rpcserver INFO     Called get_all_users
teamware02-nginx-1      | 193.171.142.175 - - [11/Mar/2024:13:27:56 +0000] "POST /rpc/ HTTP/1.1" 200 143 "http://pflaume.ofai.at:8076/manageusers" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0" "-"
teamware02-backend-1    | 2024-03-11 13:31:37,859 backend.rpcserver ERROR    Unknown rpc exception on method  admin_update_user
teamware02-backend-1    | Traceback (most recent call last):
teamware02-backend-1    |   File "/app/backend/rpcserver.py", line 130, in post
teamware02-backend-1    |     result = method.function(request, *params)
teamware02-backend-1    |   File "/app/backend/rpc.py", line 972, in admin_update_user
teamware02-backend-1    |     user = User.objects.get(id=user_dict["id"])
teamware02-backend-1    |   File "/app/.local/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
teamware02-backend-1    |     return getattr(self.get_queryset(), name)(*args, **kwargs)
teamware02-backend-1    |   File "/app/.local/lib/python3.9/site-packages/django/db/models/query.py", line 435, in get
teamware02-backend-1    |     raise self.model.DoesNotExist(
teamware02-backend-1    | backend.models.ServiceUser.DoesNotExist: ServiceUser matching query does not exist.
teamware02-backend-1    | 2024-03-11 13:31:37,862 django.request ERROR    Internal Server Error: /rpc/
teamware02-nginx-1      | 193.171.142.175 - - [11/Mar/2024:13:31:37 +0000] "POST /rpc/ HTTP/1.1" 500 117 "http://pflaume.ofai.at:8076/manageusers" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0" "-"
teamware02-backend-1    | 2024-03-11 13:35:16,681 backend.rpcserver ERROR    Unknown rpc exception on method  admin_update_user
teamware02-backend-1    | Traceback (most recent call last):
teamware02-backend-1    |   File "/app/backend/rpcserver.py", line 130, in post
teamware02-backend-1    |     result = method.function(request, *params)
teamware02-backend-1    |   File "/app/backend/rpc.py", line 972, in admin_update_user
teamware02-backend-1    |     user = User.objects.get(id=user_dict["id"])
teamware02-backend-1    |   File "/app/.local/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
teamware02-backend-1    |     return getattr(self.get_queryset(), name)(*args, **kwargs)
teamware02-backend-1    |   File "/app/.local/lib/python3.9/site-packages/django/db/models/query.py", line 435, in get
teamware02-backend-1    |     raise self.model.DoesNotExist(
teamware02-backend-1    | backend.models.ServiceUser.DoesNotExist: ServiceUser matching query does not exist.
teamware02-backend-1    | 2024-03-11 13:35:16,682 django.request ERROR    Internal Server Error: /rpc/
@johann-petrak johann-petrak added the bug Something isn't working label Mar 11, 2024
@ianroberts
Copy link
Member

The bug here is that the form fields should be disabled when no user is selected in the left hand list - this page is to edit details of a user, there is no UI to create a new user other than for that user to register themselves via the registration page. We've discussed in the past the possibility of implementing some way for admins to create new users bypassing the usual email address verification process, but it's not implemented yet (other than by running django-admin commands in the backend container).

If, as you've hinted in your previous issue #401, you've configured your teamware not to send emails (by enabling the console backend), then there's no reason why you couldn't "register" these new users yourself using the standard registration form, then assign them privileges by logging in as your admin account.

@johann-petrak
Copy link
Author

Ah yes, that form is confusing for sure!

Allowing the admin to add users would also be very convenient though because there are situations where one wants to provide users with existing name/pw - signing out as admin, then registering for each user, signing out etc is a bit clumsy for that purpose. If absolutely not wanted, maybe add a remark to the user management page that new users always need to register themselves?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants