Users should not being systematically redirected to `/survey/1`
An undesired side effect of users being redirected to /survey/1
(original purpose: make sure people complete the surveys before working with the plateform) is that, if there are no survey, the first post login behavior is a 404 error.
The redirect happens because of OnboardedTemplateView
and its handle_no_permission
the redirects to ui-survey-detail
here with this "nasty" hard coded constant here. SurveyView
uses get_object_or_404
.
There a number of other options
- no redirection to
survey
but a decorator on all views checkinguser_onboarded
+ message to user - changing
SurveyView
so it does not return 404 if there are no survey - redirecting to
surveys/
and fixing its views, for it always redirects tosurvey/1