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

error in oauth #335

Closed
antoineverin opened this issue Oct 22, 2024 · 0 comments · Fixed by #340
Closed

error in oauth #335

antoineverin opened this issue Oct 22, 2024 · 0 comments · Fixed by #340
Assignees

Comments

@antoineverin
Copy link
Contributor

django    | 2024-10-22 10:25:03,657 [ERROR] django.request: Internal Server Error: /auth/authorize/
django    | Traceback (most recent call last):
django    |   File "/app/ft_auth/views.py", line 102, in authorize
django    |     user = ft_oauth(token).user
django    |            ^^^^^^^^^^^^^^^
django    |   File "/app/ft_auth/oauth.py", line 33, in ft_oauth
django    |     oauth = FtOauth.objects.get(ft_id=oauth['id'])
django    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django    |   File "/usr/local/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method
django    |     return getattr(self.get_queryset(), name)(*args, **kwargs)
django    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django    |   File "/usr/local/lib/python3.12/site-packages/django/db/models/query.py", line 649, in get
django    |     raise self.model.DoesNotExist(
django    | ft_auth.models.FtOauth.DoesNotExist: FtOauth matching query does not exist.
django    | 
django    | During handling of the above exception, another exception occurred:
django    | 
django    | Traceback (most recent call last):
django    |   File "/app/ft_auth/views.py", line 111, in authorize
django    |     user = ft_register(token, data['username']).user
django    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django    |   File "/app/ft_auth/oauth.py", line 26, in ft_register
django    |     user = User.objects.create_user(username)
django    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django    |   File "/app/ft_auth/manager.py", line 8, in create_user
django    |     raise TypeError(_('No username provided'))
django    | TypeError: No username provided
django    | 
django    | During handling of the above exception, another exception occurred:
django    | 
django    | Traceback (most recent call last):
django    |   File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 518, in thread_handler
django    |     raise exc_info[1]
django    |   File "/usr/local/lib/python3.12/site-packages/django/core/handlers/exception.py", line 42, in inner
django    |     response = await get_response(request)
django    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
django    |   File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 518, in thread_handler
django    |     raise exc_info[1]
django    |   File "/usr/local/lib/python3.12/site-packages/django/core/handlers/base.py", line 253, in _get_response_async
django    |     response = await wrapped_callback(
django    |                ^^^^^^^^^^^^^^^^^^^^^^^
django    |   File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 468, in __call__
django    |     ret = await asyncio.shield(exec_coro)
django    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django    |   File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
django    |     result = self.fn(*self.args, **self.kwargs)
django    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django    |   File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 522, in thread_handler
django    |     return func(*args, **kwargs)
django    |            ^^^^^^^^^^^^^^^^^^^^^
django    |   File "/usr/local/lib/python3.12/site-packages/django/views/decorators/http.py", line 64, in inner
django    |     return func(request, *args, **kwargs)
django    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django    |   File "/app/ft_auth/views.py", line 117, in authorize
django    |     return JsonResponse({'error': err.messages, 'code': 2}, status=400)
django    |                                   ^^^^^^^^^^^^
django    | AttributeError: 'TypeError' object has no attribute 'messages'
@antoineverin antoineverin self-assigned this Oct 22, 2024
@antoineverin antoineverin linked a pull request Oct 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant