Forms

django-change-email ships a django.forms.ModelForm class that handles the validation of new email addresses:

EmailChangeForm

class change_email.forms.EmailChangeForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=u':', empty_permitted=False, instance=None)

A form to allow users to change the email address they have registered with.

Just consists of an forms.EmailField with a validate_email_not_used validator to check if a given email address is not already used.

new_email

EmailField (Required)

Parameters:
  • error_messages – {u’required’: u’This field is required.’, u’invalid’: u’Enter a valid email address.’}
  • help_text – Please enter your new email address.
  • localize – False
  • validators – [‘EmailValidator‘, ‘EmailNotUsedValidator‘]
  • widget – TextInput