helpdesk.views module

class helpdesk.views.HelpdeskView(**kwargs)[source]

Bases: django.contrib.auth.mixins.LoginRequiredMixin, django.views.generic.list.ListView

model

alias of helpdesk.models.Ticket

template_name = 'helpdesk/helpdesk.html'
get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

get_context_data(*args, **kwargs)[source]

Get the context for this view.

class helpdesk.views.QueueCreateView(**kwargs)[source]

Bases: scipost.mixins.PermissionsMixin, django.views.generic.edit.CreateView

Add a new Queue. Accessible to users with permission: can_add_queue.

permission_required = 'helpdesk.add_queue'
model

alias of helpdesk.models.Queue

form_class

alias of helpdesk.forms.QueueForm

template_name = 'helpdesk/queue_form.html'
get_initial(*args, **kwargs)[source]

Return the initial data to use for forms on this view.

form_valid(form)[source]

Assign appropriate object-level permissions to managing and response groups.

class helpdesk.views.QueueUpdateView(**kwargs)[source]

Bases: guardian.mixins.PermissionRequiredMixin, django.views.generic.edit.UpdateView

permission_required = 'helpdesk.can_manage_queue'
model

alias of helpdesk.models.Queue

form_class

alias of helpdesk.forms.QueueForm

template_name = 'helpdesk/queue_form.html'
form_valid(form)[source]

Update object-level permissions: remove all existing, then reassign.

class helpdesk.views.QueueDeleteView(**kwargs)[source]

Bases: guardian.mixins.PermissionRequiredMixin, django.views.generic.edit.DeleteView

permission_required = 'helpdesk.can_manage_queue'
model

alias of helpdesk.models.Queue

success_url = '/helpdesk/'
delete(request, *args, **kwargs)[source]

A Queue can only be deleted if it has no descendant Queues. Upon deletion, all object-level permissions associated to the Queue are explicitly removed, to avoid orphaned permissions.

class helpdesk.views.QueueDetailView(**kwargs)[source]

Bases: guardian.mixins.PermissionRequiredMixin, django.views.generic.detail.DetailView

permission_required = 'helpdesk.can_view_queue'
model

alias of helpdesk.models.Queue

template_name = 'helpdesk/queue_detail.html'
get_context_data(*args, **kwargs)[source]

Insert the single object into the context dict.

class helpdesk.views.TicketCreateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.LoginRequiredMixin, django.views.generic.edit.CreateView

model

alias of helpdesk.models.Ticket

form_class

alias of helpdesk.forms.TicketForm

template_name = 'helpdesk/ticket_form.html'
get_context_data(*args, **kwargs)[source]

Insert the form into the context dict.

get_initial(*args, **kwargs)[source]

Return the initial data to use for forms on this view.

class helpdesk.views.TicketUpdateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.UserPassesTestMixin, django.views.generic.edit.UpdateView

model

alias of helpdesk.models.Ticket

form_class

alias of helpdesk.forms.TicketForm

template_name = 'helpdesk/ticket_form.html'
test_func()[source]
form_valid(form)[source]

If the form is valid, save the associated model.

class helpdesk.views.TicketDeleteView(**kwargs)[source]

Bases: django.contrib.auth.mixins.UserPassesTestMixin, django.views.generic.edit.DeleteView

model

alias of helpdesk.models.Ticket

success_url = '/helpdesk/'
test_func()[source]
class helpdesk.views.TicketAssignView(**kwargs)[source]

Bases: django.contrib.auth.mixins.UserPassesTestMixin, django.views.generic.edit.UpdateView

model

alias of helpdesk.models.Ticket

form_class

alias of helpdesk.forms.TicketAssignForm

template_name = 'helpdesk/ticket_assign.html'
test_func()[source]
form_valid(form)[source]

If the form is valid, save the associated model.

helpdesk.views.is_ticket_creator_or_handler(request, pk)[source]

Details of a ticket can only be viewed by ticket creator, or handlers.

class helpdesk.views.TicketDetailView(**kwargs)[source]

Bases: django.contrib.auth.mixins.UserPassesTestMixin, django.views.generic.detail.DetailView

model

alias of helpdesk.models.Ticket

template_name = 'helpdesk/ticket_detail.html'
test_func()[source]
class helpdesk.views.TicketFollowupView(**kwargs)[source]

Bases: django.contrib.auth.mixins.UserPassesTestMixin, django.views.generic.edit.CreateView

model

alias of helpdesk.models.Followup

form_class

alias of helpdesk.forms.FollowupForm

template_name = 'helpdesk/followup_form.html'
test_func()[source]
get_initial()[source]

Return the initial data to use for forms on this view.

form_valid(form)[source]

If the form is valid, save the associated model.

class helpdesk.views.TicketMarkResolved(**kwargs)[source]

Bases: helpdesk.views.TicketFollowupView

get_initial()[source]

Return the initial data to use for forms on this view.

form_valid(form)[source]

If the form is valid, save the associated model.

class helpdesk.views.TicketMarkClosed(**kwargs)[source]

Bases: helpdesk.views.TicketFollowupView

get_initial()[source]

Return the initial data to use for forms on this view.

form_valid(form)[source]

If the form is valid, save the associated model.