|
|
@ -193,18 +193,18 @@ class ProfileEditForm(forms.Form): |
|
|
|
# pass |
|
|
|
# return username |
|
|
|
# |
|
|
|
# def clean_email(self): |
|
|
|
# err_logger = logging.getLogger('seminar.prihlaska.problem') |
|
|
|
# email = self.cleaned_data.get('email') |
|
|
|
# try: |
|
|
|
# Osoba.objects.get(email=email) |
|
|
|
# msg = "Email {} exists".format(email) |
|
|
|
# err_logger.info(msg) |
|
|
|
# raise forms.ValidationError('Email je již použit') |
|
|
|
# |
|
|
|
# except ObjectDoesNotExist: |
|
|
|
# pass |
|
|
|
# return email |
|
|
|
def clean_email(self): |
|
|
|
err_logger = logging.getLogger('seminar.prihlaska.problem') |
|
|
|
email = self.cleaned_data.get('email') |
|
|
|
try: |
|
|
|
Osoba.objects.get(email=email) |
|
|
|
msg = "Email {} exists (in edit)".format(email) |
|
|
|
err_logger.info(msg) |
|
|
|
raise forms.ValidationError('Email je již použit') |
|
|
|
|
|
|
|
except ObjectDoesNotExist: |
|
|
|
pass |
|
|
|
return email |
|
|
|
#def clean(self): |
|
|
|
# super().clean() |
|
|
|
# |
|
|
|