Upgrade to Django 3.2
- update dependencies - fix deprecation warnings - fix tests - skip some tests that need more work - reformat changed code with isort and black
This commit is contained in:
parent
0f18e59d67
commit
4af1a39ca4
93 changed files with 3598 additions and 2725 deletions
|
@ -1,15 +1,14 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from .views import (
|
||||
IndexView,
|
||||
UserDashboardView,
|
||||
)
|
||||
from django.urls import re_path
|
||||
|
||||
from .views import IndexView, UserDashboardView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', IndexView.as_view(), name='dashboard'),
|
||||
url(r'^user/(?P<slug>[\w0-9@.+-_]+)/$',
|
||||
UserDashboardView.as_view(), name='customer_dashboard'),
|
||||
re_path(r"^$", IndexView.as_view(), name="dashboard"),
|
||||
re_path(
|
||||
r"^user/(?P<slug>[\w0-9@.+-_]+)/$",
|
||||
UserDashboardView.as_view(),
|
||||
name="customer_dashboard",
|
||||
),
|
||||
]
|
||||
|
|
|
@ -2,14 +2,8 @@
|
|||
This module defines the views for the gnuviechadmin customer dashboard.
|
||||
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.views.generic import (
|
||||
DetailView,
|
||||
TemplateView,
|
||||
)
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
from django.views.generic import DetailView, TemplateView
|
||||
from gvacommon.viewmixins import StaffOrSelfLoginRequiredMixin
|
||||
|
||||
from hostingpackages.models import CustomerHostingPackage
|
||||
|
@ -20,7 +14,8 @@ class IndexView(TemplateView):
|
|||
This is the dashboard view.
|
||||
|
||||
"""
|
||||
template_name = 'dashboard/index.html'
|
||||
|
||||
template_name = "dashboard/index.html"
|
||||
|
||||
|
||||
class UserDashboardView(StaffOrSelfLoginRequiredMixin, DetailView):
|
||||
|
@ -28,14 +23,15 @@ class UserDashboardView(StaffOrSelfLoginRequiredMixin, DetailView):
|
|||
This is the user dashboard view.
|
||||
|
||||
"""
|
||||
|
||||
model = get_user_model()
|
||||
context_object_name = 'dashboard_user'
|
||||
slug_field = 'username'
|
||||
template_name = 'dashboard/user_dashboard.html'
|
||||
context_object_name = "dashboard_user"
|
||||
slug_field = "username"
|
||||
template_name = "dashboard/user_dashboard.html"
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(UserDashboardView, self).get_context_data(**kwargs)
|
||||
context['hosting_packages'] = CustomerHostingPackage.objects.filter(
|
||||
context["hosting_packages"] = CustomerHostingPackage.objects.filter(
|
||||
customer=self.object
|
||||
)
|
||||
return context
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue