SciPost Code Repository

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

update referee invitations of new contributors

parent 3f34109d
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ __license__ = "AGPL v3" ...@@ -3,6 +3,7 @@ __license__ = "AGPL v3"
import datetime import datetime
from django.db.models import Q
import pyotp import pyotp
import re import re
...@@ -309,6 +310,15 @@ class RegistrationForm(forms.Form): ...@@ -309,6 +310,15 @@ class RegistrationForm(forms.Form):
contributor.user.is_active = True contributor.user.is_active = True
contributor.user.save() contributor.user.save()
# Update referee invitations to use the new Contributor
RefereeInvitation.objects.awaiting_response().filter(
Q(referee__isnull=True)
& (
Q(email_address=contributor.user.email)
| Q(invitation_key=contributor.invitation_key)
)
).update(referee=contributor)
return contributor return contributor
......
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