Remove duplicate functionality

- remove customer hosting package list
- replace useless dashboard with redirect
- move all hosting package list for superuser to top level menu item
- replace btn-default with btn-secondary
- improve email address management page
This commit is contained in:
Jan Dittberner 2023-04-29 12:35:49 +02:00
parent 2d05580ed3
commit 866f6c8083
16 changed files with 142 additions and 214 deletions

View file

@ -4,6 +4,7 @@ This module defines the views for the gnuviechadmin customer dashboard.
"""
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect
from django.views.generic import DetailView, TemplateView
from gvacommon.viewmixins import StaffOrSelfLoginRequiredMixin
@ -18,6 +19,11 @@ class IndexView(LoginRequiredMixin, TemplateView):
template_name = "dashboard/index.html"
def dispatch(self, request, *args, **kwargs):
if not request.user.is_anonymous:
return redirect("customer_dashboard", slug=request.user.username)
return super().dispatch(request, *args, **kwargs)
class UserDashboardView(StaffOrSelfLoginRequiredMixin, DetailView):
"""