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

AnonymousUser accessing /assignments/1/new/ raises exception #245

Open
johenning opened this issue Nov 20, 2018 · 1 comment · Fixed by #246
Open

AnonymousUser accessing /assignments/1/new/ raises exception #245

johenning opened this issue Nov 20, 2018 · 1 comment · Fixed by #246
Milestone

Comments

@johenning
Copy link
Contributor

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.

@troeger
Copy link
Owner

troeger commented Nov 28, 2018

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

@troeger troeger reopened this Nov 28, 2018
@troeger troeger added this to the Next Release milestone Jan 29, 2019
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.

2 participants