management.views.notificationsΒΆ

Defines views for managing notifications.

Module ContentsΒΆ

class management.views.notifications.RefreshNotificationsView(**kwargs)[source]ΒΆ

Bases: trustpoint.logger.LoggerMixin, django.views.generic.TemplateView

View to execute all notifications and redirect back to dashboard.

get(request, *args, **kwargs)[source]ΒΆ

Handles GET requests and redirects to the dashboard.

Parameters:
  • request (django.http.HttpRequest) – The HTTP request object.

  • *args (Any) – Additional positional arguments.

  • **kwargs (Any) – Keyword arguments passed to super().get_context_data.

Returns:

dashboard.

Return type:

The response that redirects the user to home

class management.views.notifications.NotificationDeleteView[source]ΒΆ

Bases: trustpoint.logger.LoggerMixin, django.views.generic.DeleteView[management.models.NotificationModel, Any]

View to delete a notification.

model: type[management.models.NotificationModel][source]ΒΆ
template_name = 'home/notification_confirm_delete.html'[source]ΒΆ
success_url[source]ΒΆ
delete(request, *args, **kwargs)[source]ΒΆ

Override delete method to add a success message.

Parameters:
  • request (django.http.HttpRequest) – The HTTP request object.

  • *args (Any) – Additional positional arguments.

  • **kwargs (Any) – Keyword arguments passed to super().delete.

Returns:

The HTTP response redirecting to success_url.

Return type:

django.http.HttpResponse