-
Notifications
You must be signed in to change notification settings - Fork 165
fix #2555 language x in preview #2556
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
base: main
Are you sure you want to change the base?
Conversation
niklasmohrin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also still need a test that checks that accessing the page works :)
|
one more thing: the magic "fix #..." line should be in the PR description, not the PR title or commit message. You can still change this, and then you will see that this PR will be automatically linked to the issue in the "Development" section on the right of the page. |
evap/student/views.py
Outdated
| for_rendering_in_modal: bool = False, | ||
| ) -> HttpResponse: | ||
| if evaluation.main_language == evaluation.UNDECIDED_MAIN_LANGUAGE: | ||
| evaluation.main_language = "en" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this is not quite right and makes me afraid that we display (or even save!) this wrongly somewhere later - a caller using render_vote_page likely does not expect that the evaluation gets changed in here.
What do you think about going a bit more defensive and defining an extra variable fallback_language which is evaluation.main_language or "en" if the main language is not decided. Then we use this variable in request.GET.get("language", fallback_language). How do you feel about this change?
niklasmohrin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good, but still needs tests
#2555 Preview of evaluation form failed with undecided language. Fixed by checking in render_vote_page()