Check for duplicate emails

This commit is contained in:
Yingtong Li 2019-03-06 10:54:52 +11:00
parent 168a8c17bc
commit b8bd3facc3
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -136,6 +136,9 @@ def import_save(request):
errors = member.validation_problems() errors = member.validation_problems()
if models.Member.objects.filter(email=request.POST['email']).count() > 0:
errors.append('Member with this email already exists')
if len(errors) > 0: if len(errors) > 0:
return render(request, 'ssmembership/import/review.html', { return render(request, 'ssmembership/import/review.html', {
'member': member, 'member': member,