remove private textanswers#2696
Open
fidoriel wants to merge 2 commits intoe-valuation:mainfrom
Open
Conversation
507a293 to
88754bd
Compare
88754bd to
53e8bb5
Compare
richardebeling
requested changes
Apr 13, 2026
Comment on lines
+6
to
+8
| def forwards(apps, schema_editor): # pylint: disable=unused-argument | ||
| TextAnswer = apps.get_model("evaluation", "TextAnswer") | ||
| TextAnswer.objects.filter(review_decision="PU").update(review_decision="KE") |
Member
There was a problem hiding this comment.
As discussed: We need to actually call this -- please also name it a bit more descriptively (what does the method actually do?)
| for contribution in evaluation.contributions.all() | ||
| for textanswer in contribution.textanswer_set.all() | ||
| if textanswer.review_decision in [TextAnswer.ReviewDecision.PRIVATE, TextAnswer.ReviewDecision.PUBLIC] | ||
| if textanswer.review_decision in TextAnswer.ReviewDecision.KEEP |
Member
There was a problem hiding this comment.
Suggested change
| if textanswer.review_decision in TextAnswer.ReviewDecision.KEEP | |
| if textanswer.review_decision == TextAnswer.ReviewDecision.KEEP |
Member
There was a problem hiding this comment.
Let's just put this in one migration. Semantically, this is one operation.
janno42
requested changes
Apr 13, 2026
| @@ -140360,7 +140360,7 @@ | |||
| "pk": 393, | |||
| "fields": { | |||
| "is_superuser": false, | |||
| "password": "pbkdf2_sha256$20000$cZek9pUwPWjz$HOcVeL8Q7himlOTBlPRkP79kJq5aGpXRkzQy6Y0Twok=", | |||
| "password": "pbkdf2_sha256$20000$cZek9pUwPWjz$HOcVeL8Q7himlOTBlKEkP79kJq5aGpXRkzQy6Y0Twok=", | |||
| name="TextAnswer_review_decision_choices", | ||
| ), | ||
| ), | ||
| migrations.RunPython(rename_private_and_public_to_keep, reverse_code=reverse), |
Member
There was a problem hiding this comment.
Don't we need to have this RunPython before the AddConstraint above?
| TextAnswer.objects.filter(review_decision="PU").update(review_decision="KE") | ||
|
|
||
|
|
||
| def reverse(apps, schema_editor): # pylint: disable=unused-argument |
Member
There was a problem hiding this comment.
Can we call it rename_keep_to_public?
Member
niklasmohrin
left a comment
There was a problem hiding this comment.
(removing request, please re-request once other comments are resolved)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
closes #2363