opensubmit icon indicating copy to clipboard operation
opensubmit copied to clipboard

AnonymousUser accessing /assignments/1/new/ raises exception

Open johenning opened this issue 5 years ago • 1 comments

In the class SubmissionNewView (web/opensubmit/views/frontend.py the LoginRequiredMixin redirection mechanism is overwritten by the dispatch function, which calls can_create_submission and produces an Exception, because an authorized user is expected. (Exception: 'AnonymousUser' object has no attribute 'profile')

The simple fix is to check user.is_authenticated() in the dispatch function. The right way to fix this would probably be writing a custom Mixin for checking submission priviledges.

johenning avatar Nov 20 '18 16:11 johenning

Keeping this issue open, in order to get a better solution that keeps the LoginRequiredMixin intact.

troeger avatar Nov 28 '18 12:11 troeger