2015-01-17 14:01:22 +01:00
|
|
|
"""
|
|
|
|
This module defines the views for the gnuviechadmin customer dashboard.
|
|
|
|
|
|
|
|
"""
|
2015-01-20 00:47:24 +01:00
|
|
|
from django.contrib.auth import get_user_model
|
2023-04-14 19:33:44 +02:00
|
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
2023-04-29 12:35:49 +02:00
|
|
|
from django.shortcuts import redirect
|
2023-02-18 22:46:48 +01:00
|
|
|
from django.views.generic import DetailView, TemplateView
|
2015-01-24 16:12:23 +01:00
|
|
|
from gvacommon.viewmixins import StaffOrSelfLoginRequiredMixin
|
2015-01-17 14:01:22 +01:00
|
|
|
|
2015-01-18 16:19:28 +01:00
|
|
|
from hostingpackages.models import CustomerHostingPackage
|
|
|
|
|
2015-01-17 14:01:22 +01:00
|
|
|
|
2023-04-29 13:10:25 +02:00
|
|
|
class UserDashboardView(LoginRequiredMixin, TemplateView):
|
2015-01-17 14:01:22 +01:00
|
|
|
"""
|
|
|
|
This is the user dashboard view.
|
|
|
|
|
|
|
|
"""
|
2023-02-18 22:46:48 +01:00
|
|
|
|
|
|
|
template_name = "dashboard/user_dashboard.html"
|
2015-01-17 15:42:47 +01:00
|
|
|
|
2015-01-18 16:19:28 +01:00
|
|
|
def get_context_data(self, **kwargs):
|
|
|
|
context = super(UserDashboardView, self).get_context_data(**kwargs)
|
2023-02-18 22:46:48 +01:00
|
|
|
context["hosting_packages"] = CustomerHostingPackage.objects.filter(
|
2023-04-29 13:10:25 +02:00
|
|
|
customer=self.request.user
|
2015-01-18 16:19:28 +01:00
|
|
|
)
|
|
|
|
return context
|