diff --git a/scipost/forms.py b/scipost/forms.py index 225d07282a4a0c4d6d39369402eea04120519e73..8b5d9a842e0cd3815193404de2b248a249e18e4a 100644 --- a/scipost/forms.py +++ b/scipost/forms.py @@ -186,10 +186,10 @@ class RegistrationForm(forms.Form): orcid_id=self.cleaned_data['orcid_id'], webpage=self.cleaned_data['personalwebpage']) # Add a ProfileEmail to this Profile - ProfileEmail.objects.get_or_create( - profile=profile, - email=self.cleaned_data['email'], - primary=True) + profile_email = ProfileEmail.objects.get_or_create( + profile=profile, email=self.cleaned_data['email']) + profile.emails.update(primary=False) + profile.emails.filter(id=profile_email.id).update(primary=True, still_valid=True) # Create an Affiliation for this Profile current_affiliation = self.cleaned_data.get('current_affiliation', None) if current_affiliation: