Verified Commit 7c8be8d5 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Add check to model for registrations with same email

parent 5812cf68
......@@ -245,7 +245,9 @@ class Registration(Entry):
super().clean()
errors = {}
if get_user_model().objects.filter(email=self.email).exists():
if (get_user_model().objects.filter(email=self.email).exists() or
Registration.objects.filter(email=self.email)
.exclude(pk=self.pk).exists()):
errors.update({
'email': _('A user with that email address already exists. '
'Login using the existing account and renew the '
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment