Fix Django Debug Toolbar redirect loop in Quizzes#800
Conversation
|
I agree that my PR looks more like a workaround than a "clean fix." Since the mentioned PR has not been merged yet, I am cautious about making any breaking changes around it. I would prefer to see the decorator used in multiple cases, so we don't end up with something like I have removed the changes you found problematic. Should we merge it as just a fix for #739, or close it and explore another approach without the middleware? |
There was a problem hiding this comment.
I think that prohibiting during quizzes and tests will be essentially the same thing, so we could just use a single decorator that blocks an endpoint if you have an active test exam OR an active quiz.
Nevertheless, this looks like a clear fix to the original issue, so I'm fine with merging it as is.
Closes #739.
I have modified the Quiz middleware to exclude Django Debug Toolbar endpoints from redirection. I also added the
infoendpoint to the excluded ones, since it may be useful for the frontend and does not output any information that could negatively interrupt the quiz process. Finally, I completely removed notifications from the main layout during the quiz, as I believe notifications are unnecessary while taking a quiz. It also prevents callingnotification/allendpoint, which redirects toquiznow.