added missing/incomplete permissions to views
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
|
||||
from django.shortcuts import render
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from containers.models import Container
|
||||
|
||||
|
||||
class BarrierDashboardView(TemplateView):
|
||||
class BarrierDashboardView(LoginRequiredMixin, UserPassesTestMixin, TemplateView):
|
||||
template_name = 'barrier/barrier-dashboard.html'
|
||||
|
||||
def test_func(self):
|
||||
return self.request.user.user_type == 'BA'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
recent_containers = Container.objects.select_related('line', 'booking').order_by('-expedited_on', '-received_on')[:10]
|
||||
|
||||
Reference in New Issue
Block a user