web.views.mailbox_views.UploadEmailView module

Module with the web.views.UploadEmailView view class.

class web.views.mailbox_views.UploadEmailView.UploadEmailView(**kwargs)[source]

Bases: LoginRequiredMixin, DetailView, FormView

View for uploading email and mailbox files to a mailbox.

URL_NAME = 'mailbox-upload'
model

alias of Mailbox

context_object_name = 'mailbox'
form_class

alias of UploadEmailForm

template_name = 'web/mailbox/upload_email.html'
get_success_url()[source]

Gets the success_url of the upload.

Return type:

str

Returns:

The detail url of the mailbox.

get_queryset()[source]

Restricts the queryset to objects owned by the requesting user.

Return type:

QuerySet

form_valid(form)[source]

Runs when the request form data is valid.

Parameters:

form (UploadEmailForm) – The form of the request data.

Return type:

HttpResponse

Returns:

A django.http.HttpResponse redirecting to success_url.

form_invalid(form)[source]

Runs when the request form data is invalid.

Note

This override is required to reconcile FormView and DetailView.

Parameters:

form (UploadEmailForm) – The form of the request data.

Return type:

HttpResponse

Returns:

A django.http.HttpResponse redirecting to success_url.