SciPost Code Repository

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

automatically vet contributors with invitation key

fixes #124
parent 4c969943
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ from dal import autocomplete ...@@ -24,6 +24,7 @@ from dal import autocomplete
from .behaviors import orcid_validator from .behaviors import orcid_validator
from .constants import ( from .constants import (
NORMAL_CONTRIBUTOR,
TITLE_CHOICES, TITLE_CHOICES,
SCIPOST_FROM_ADDRESSES, SCIPOST_FROM_ADDRESSES,
UNVERIFIABLE_CREDENTIALS, UNVERIFIABLE_CREDENTIALS,
...@@ -298,6 +299,16 @@ class RegistrationForm(forms.Form): ...@@ -298,6 +299,16 @@ class RegistrationForm(forms.Form):
} }
) )
contributor.save() contributor.save()
# Automatically vet the Contributor if they have an invitation key
if contributor.invitation_key:
contributor.status = NORMAL_CONTRIBUTOR
contributor.save()
group = Group.objects.get(name="Registered Contributors")
contributor.user.groups.add(group)
contributor.user.is_active = True
contributor.user.save()
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