예제 #1
0
파일: forms.py 프로젝트: schumannd/EvaP
    def clean_email(self):
        email = self.cleaned_data.get('email')

        if not UserProfile.email_needs_login_key(email):
            raise forms.ValidationError(_("HPI users cannot request login keys. Please login using your domain credentials."))

        try:
            user = UserProfile.objects.get(email__iexact=email)
            self.user_cache = user
        except UserProfile.DoesNotExist:
            raise forms.ValidationError(_("No user with this email address was found. Please make sure to enter the email address already known to the university office."))

        return email
예제 #2
0
파일: forms.py 프로젝트: PFischbeck/EvaP
    def clean_email(self):
        email = self.cleaned_data.get('email')

        if not UserProfile.email_needs_login_key(email):
            raise forms.ValidationError(_("HPI users cannot request login keys. Please login using your domain credentials."))

        try:
            user = UserProfile.objects.get(email__iexact=email)
            self.user_cache = user
        except UserProfile.DoesNotExist:
            raise forms.ValidationError(_("No user with this email address was found. Please make sure to enter the email address used for course or event registration."))

        if not user.is_active:
            raise forms.ValidationError(_("Inactive users cannot request login keys."))

        return email
예제 #3
0
    def clean_email(self):
        email = self.cleaned_data.get('email')

        if not UserProfile.email_needs_login_key(email):
            raise forms.ValidationError(
                _("HPI users cannot request login keys. Please login using your domain credentials."
                  ))

        try:
            user = UserProfile.objects.get(email__iexact=email)
            self.user_cache = user
        except UserProfile.DoesNotExist as e:
            raise forms.ValidationError(
                _("No user with this email address was found. Please make sure to enter the email address used for registration."
                  )) from e

        if not user.is_active:
            raise forms.ValidationError(
                _("Inactive users cannot request login keys."))

        return email