Views

All of the following documented views are:

  • only accessible to logged in users.
  • Class based generic views. These are further documented in the Django documentation.

EmailChangeConfirmView

class change_email.views.EmailChangeConfirmView(*args, **kwargs)

Bases: django.views.generic.base.TemplateView

A view to confirm an email address change request.

object = None

An instance of EmailChange, if found.

template_name = 'change_email/emailchange_confirm.html'

The template used to render this view.

dispatch(*args, **kwargs)

If an EmailChange object that has been created by the user is not found, the user will be redirected to EmailChangeCreateView.

get_context_data(**kwargs)

Inserts following variables into the context:

object
An instance of EmailChange.
confirmed
A boolean determining if the change request has been confirmed succesfully.
save()

Saves the new email address to django.contrib.auth.models.User and send a email_change_confirmed signal.

EmailChangeCreateView

class change_email.views.EmailChangeCreateView(**kwargs)

Bases: django.views.generic.edit.CreateView

A view to create an EmailChange object.

form_class

alias of EmailChangeForm

model

alias of EmailChange

dispatch(*args, **kwargs)

If an EmailChange object that has been created by the user is found, the user will be redirected to EmailChangeDetailView.

form_valid(*args, **kwargs)

Saves the email address change request, sends an email to confirm the request, adds a success message for the user and redirects to EmailChangeDetailView.

EmailChangeDeleteView

class change_email.views.EmailChangeDeleteView(**kwargs)

Bases: django.views.generic.edit.DeleteView

A view to delete an EmailChange object.

model

alias of EmailChange

dispatch(*args, **kwargs)

If an EmailChange object that has been created by the user is not found, the user will be redirected to EmailChangeCreateView.

get_success_url(**kwargs)

Returns the URL to redirect to after an email address change request has been deleted by an user. The URL to redirect to can be customized by setting EMAIL_CHANGE_DELETE_SUCCESS_REDIRECT_URL.

EmailChangeDetailView

class change_email.views.EmailChangeDetailView(**kwargs)

Bases: django.views.generic.detail.DetailView

A view to display an EmailChange object.

model

alias of EmailChange

dispatch(*args, **kwargs)

If an EmailChange object that has been created by the user is not found, the user will be redirected to EmailChangeCreateView.

EmailChangeIndexView

class change_email.views.EmailChangeIndexView(**kwargs)

Bases: django.views.generic.base.RedirectView

A view to redirect users to other views.

permanent = False

Determines that this view will always issue a HTTP 307 (Temporary Redirect) status code.

get_redirect_url(**kwargs)

If an EmailChange object is found that has been created by the user, the user will be redirected to EmailChangeDetailView. If such an object is not found the user will be redirected to EmailChangeCreateView.