-
Notifications
You must be signed in to change notification settings - Fork 167
Questionnaires: add archived state, tabs in management page #2587
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8554149
rebase
ZoqkMaze 90fa303
update q_index_list
ZoqkMaze 679400a
fix migration
ZoqkMaze c5c16f1
Update evap/static/scss/_adjustments.scss
ZoqkMaze bf91244
add scss comment
ZoqkMaze 539368f
remove active tab
ZoqkMaze bae093c
fix comment
ZoqkMaze File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...luation/migrations/0164_remove_questionnaire_questionnaire_visibility_choices_and_more.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Generated by Django 5.2.11 on 2026-03-02 21:12 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("evaluation", "0163_migrate_cms_links"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RemoveConstraint( | ||
| model_name="questionnaire", | ||
| name="Questionnaire_visibility_choices", | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="questionnaire", | ||
| name="visibility", | ||
| field=models.IntegerField( | ||
| choices=[(0, "Don't show"), (1, "Managers only"), (2, "Managers and editors"), (3, "Archived")], | ||
| default=1, | ||
| verbose_name="visibility", | ||
| ), | ||
| ), | ||
| migrations.AddConstraint( | ||
| model_name="questionnaire", | ||
| constraint=models.CheckConstraint( | ||
| condition=models.Q(("visibility__in", [0, 1, 2, 3])), name="Questionnaire_visibility_choices" | ||
| ), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,11 +175,19 @@ def get_parameter_from_url_or_session(request: HttpRequest, parameter: str, defa | |
| if result_str is None: # if no parameter is given take session value | ||
| result = request.session.get(parameter, default) | ||
| else: | ||
| result = {"true": True, "false": False}.get(result_str.lower()) # convert parameter to boolean | ||
| result = {"true": True, "false": False}.get(result_str.lower(), default) # convert parameter to boolean | ||
| request.session[parameter] = result # store value for session | ||
| return result | ||
|
|
||
|
|
||
| def get_string_from_url_or_session(request: HttpRequest, parameter: str, default: str | None = None) -> str | None: | ||
| result = request.GET.get(parameter, None) | ||
| if result is None: | ||
| result = request.session.get(parameter, default) | ||
| request.session[parameter] = result | ||
| return result | ||
|
Comment on lines
+183
to
+188
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The two helpers here are now basically the same thing, and they are named a bit weirdly. We can do it as a follow-up issue to get this merged quickly, but I guess it would be nice to think about proper names here and how to make one of these use the other one. |
||
|
|
||
|
|
||
| def translate(**kwargs): | ||
| # pylint is really buggy with this method. | ||
| # pylint: disable=unused-variable, useless-suppression | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.