SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit f4ac780d authored by George Katsikas's avatar George Katsikas :goat:
Browse files

restore anonymized report info before the reports

parent 3e3feb88
No related branches found
No related tags found
No related merge requests found
...@@ -73,6 +73,12 @@ class Command(BaseCommand): ...@@ -73,6 +73,12 @@ class Command(BaseCommand):
else: else:
reports_to_restore = [arc.report for arc in ARCs] reports_to_restore = [arc.report for arc in ARCs]
# Bulk-update the ARCs before updating the reports
AnonymizedReportContributor.objects.bulk_update(
ARCs,
["anonymized_author", "original_author", "invitation_email"],
)
updated_objects = [] updated_objects = []
for report in reports_to_restore: for report in reports_to_restore:
updated_objects.append( updated_objects.append(
...@@ -83,11 +89,7 @@ class Command(BaseCommand): ...@@ -83,11 +89,7 @@ class Command(BaseCommand):
ARCs, reports, invitations = zip(*updated_objects) ARCs, reports, invitations = zip(*updated_objects)
invitations = list(itertools.chain.from_iterable(invitations)) invitations = list(itertools.chain.from_iterable(invitations))
# Bulk-update the ARCs, reports, and invitations since commit=False # Bulk-update the reports, and invitations since commit=False
AnonymizedReportContributor.objects.bulk_update(
ARCs,
["anonymized_author", "original_author", "invitation_email"],
)
Report.objects.bulk_update(reports, ["author"]) Report.objects.bulk_update(reports, ["author"])
RefereeInvitation.objects.bulk_update( RefereeInvitation.objects.bulk_update(
invitations, invitations,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment