Tutors have issues while setting feedback on the participants page
It seems like there are some issues with the logic that verifies whether or not a tutor can patch feedback. This issue occurred on the participants' overview while trying to patch final feedback (which is OK in exercise mode).
Relevant Logs
[2020-05-18 11:49:44,239] [ERROR] django.request Internal Server Error: /cs1-uebung/sose2020/api/feedback/03586657-ce08-4fc8-9af2-9d4a50a2b237/
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/rest_framework/viewsets.py", line 116, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py", line 495, in dispatch
response = self.handle_exception(exc)
File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py", line 455, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py", line 492, in dispatch
response = handler(request, *args, **kwargs)
File "/code/core/views/feedback.py", line 91, in partial_update
if tutor_attempts_to_patch_first_feedback_final(serializer, self.request.user, assignment):
File "/code/core/views/util.py", line 19, in tutor_attempts_to_patch_first_feedback_final
raise NoAssignmentForTutor()
core.views.util.NoAssignmentForTutor
[2020-05-18 11:49:44,239] [ERROR] django.request Internal Server Error: /cs1-uebung/sose2020/api/feedback/03586657-ce08-4fc8-9af2-9d4a50a2b237/
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/rest_framework/viewsets.py", line 116, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py", line 495, in dispatch
response = self.handle_exception(exc)
File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py", line 455, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py", line 492, in dispatch
response = handler(request, *args, **kwargs)
File "/code/core/views/feedback.py", line 91, in partial_update
if tutor_attempts_to_patch_first_feedback_final(serializer, self.request.user, assignment):
File "/code/core/views/util.py", line 19, in tutor_attempts_to_patch_first_feedback_final
raise NoAssignmentForTutor()
core.views.util.NoAssignmentForTutor