Skip to content

remove private textanswers#2696

Open
fidoriel wants to merge 2 commits intoe-valuation:mainfrom
fidoriel:remove-private-text-answers
Open

remove private textanswers#2696
fidoriel wants to merge 2 commits intoe-valuation:mainfrom
fidoriel:remove-private-text-answers

Conversation

@fidoriel
Copy link
Copy Markdown
Collaborator

closes #2363

@fidoriel fidoriel marked this pull request as draft April 13, 2026 16:27
@fidoriel fidoriel force-pushed the remove-private-text-answers branch 3 times, most recently from 507a293 to 88754bd Compare April 13, 2026 17:25
@fidoriel fidoriel force-pushed the remove-private-text-answers branch from 88754bd to 53e8bb5 Compare April 13, 2026 17:26
@fidoriel fidoriel marked this pull request as ready for review April 13, 2026 17:36
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")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed: We need to actually call this -- please also name it a bit more descriptively (what does the method actually do?)

Comment thread evap/results/tools.py Outdated
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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if textanswer.review_decision in TextAnswer.ReviewDecision.KEEP
if textanswer.review_decision == TextAnswer.ReviewDecision.KEEP

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just put this in one migration. Semantically, this is one operation.

@@ -140360,7 +140360,7 @@
"pk": 393,
"fields": {
"is_superuser": false,
"password": "pbkdf2_sha256$20000$cZek9pUwPWjz$HOcVeL8Q7himlOTBlPRkP79kJq5aGpXRkzQy6Y0Twok=",
"password": "pbkdf2_sha256$20000$cZek9pUwPWjz$HOcVeL8Q7himlOTBlKEkP79kJq5aGpXRkzQy6Y0Twok=",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please reset

name="TextAnswer_review_decision_choices",
),
),
migrations.RunPython(rename_private_and_public_to_keep, reverse_code=reverse),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call it rename_keep_to_public?

Copy link
Copy Markdown
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(removing request, please re-request once other comments are resolved)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Remove private TextAnswers

4 participants