diff --git a/app/urls.py b/app/urls.py index 2ff65c2..77dbe3e 100644 --- a/app/urls.py +++ b/app/urls.py @@ -16,7 +16,8 @@ Including another URLconf from django.contrib import admin from django.urls import include, path -from core.views import Drilldown, Home, Profile, Signup +from core.views import Home, Profile, Signup +from core.ui.views.drilldown import Drilldown urlpatterns = [ path("", Home.as_view(), name="home"), diff --git a/core/ui/views/drilldown.py b/core/ui/views/drilldown.py new file mode 100644 index 0000000..2716ebe --- /dev/null +++ b/core/ui/views/drilldown.py @@ -0,0 +1,12 @@ +from django.contrib.auth.mixins import LoginRequiredMixin +from django.views import View +from django.shortcuts import render + + +class Drilldown(LoginRequiredMixin, View): + template_name = "ui/drilldown.html" + + def get(self, request, *args, **kwargs): + if not request.user.has_plan("drilldown"): + return render(request, "denied.html") + return render(request, self.template_name) \ No newline at end of file diff --git a/core/views.py b/core/views.py index d5e8ce8..ffde810 100644 --- a/core/views.py +++ b/core/views.py @@ -9,13 +9,7 @@ from core.forms import NewUserForm # Create your views here -class Drilldown(LoginRequiredMixin, View): - template_name = "ui/drilldown.html" - def get(self, request, *args, **kwargs): - if not request.user.has_plan("drilldown"): - return render(request, "denied.html") - return render(request, self.template_name) class Home(View):