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

bug: KK (and maybe DaTe) 500 error in polls. #667

Open
jaspnas opened this issue Dec 13, 2024 · 0 comments
Open

bug: KK (and maybe DaTe) 500 error in polls. #667

jaspnas opened this issue Dec 13, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jaspnas
Copy link
Collaborator

jaspnas commented Dec 13, 2024

Describe the bug

500 error and stacktrace in console probably related to user not being authenticated properly/token being expired.

To Reproduce

Unknown at time of writing.

Additional context
Add any other context about the problem here.

kkwebsite-web-6     | Traceback (most recent call last):
kkwebsite-web-6     |   File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 518, in thread_handler
kkwebsite-web-6     |     raise exc_info[1]
kkwebsite-web-6     |   File "/usr/local/lib/python3.12/site-packages/django/core/handlers/exception.py", line 42, in inner
kkwebsite-web-6     |     response = await get_response(request)
kkwebsite-web-6     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
kkwebsite-web-6     |   File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 518, in thread_handler
kkwebsite-web-6     |     raise exc_info[1]
kkwebsite-web-6     |   File "/usr/local/lib/python3.12/site-packages/django/core/handlers/base.py", line 253, in _get_response_async
kkwebsite-web-6     |     response = await wrapped_callback(
kkwebsite-web-6     |                ^^^^^^^^^^^^^^^^^^^^^^^
kkwebsite-web-6     |   File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 468, in __call__
kkwebsite-web-6     |     ret = await asyncio.shield(exec_coro)
kkwebsite-web-6     |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kkwebsite-web-6     |   File "/usr/local/lib/python3.12/site-packages/asgiref/current_thread_executor.py", line 40, in run
kkwebsite-web-6     |     result = self.fn(*self.args, **self.kwargs)
kkwebsite-web-6     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kkwebsite-web-6     |   File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 522, in thread_handler
kkwebsite-web-6     |     return func(*args, **kwargs)
kkwebsite-web-6     |            ^^^^^^^^^^^^^^^^^^^^^
kkwebsite-web-6     |   File "/code/polls/views.py", line 41, in vote
kkwebsite-web-6     |     return handle_vote(request, question, user, selected_choices)
kkwebsite-web-6     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kkwebsite-web-6     |   File "/code/polls/vote.py", line 88, in handle_vote
kkwebsite-web-6     |     error_message = validate_vote(request, question, user, selected_choices)
kkwebsite-web-6     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kkwebsite-web-6     |   File "/code/polls/vote.py", line 78, in validate_vote
kkwebsite-web-6     |     if is_user_authorized_to_vote(question, user):
kkwebsite-web-6     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kkwebsite-web-6     |   File "/code/polls/vote.py", line 47, in is_user_authorized_to_vote
kkwebsite-web-6     |     user.membership_type == ORDINARY_MEMBER and
kkwebsite-web-6     |     ^^^^^^^^^^^^^^^^^^^^
kkwebsite-web-6     |   File "/usr/local/lib/python3.12/site-packages/django/utils/functional.py", line 253, in inner
kkwebsite-web-6     |     return func(_wrapped, *args)
kkwebsite-web-6     |            ^^^^^^^^^^^^^^^^^^^^^
kkwebsite-web-6     | AttributeError: 'AnonymousUser' object has no attribute 'membership_type'
kkwebsite-web-6     | ERROR HTTP POST /polls/66/vote/ 500 [0.05, 192.168.32.11:41276]```
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