def get(self, *args, **kwargs): if self.request.user.is_authenticated(): if is_internal(self.request): return redirect('internal') return redirect('external') kwargs['form'] = LoginForm return super(WildlifeComplianceRoutingView, self).get(*args, **kwargs)
def is_internal(context): # checks if user is a departmentuser and logged in via single sign-on request = context['request'] return wildlifecompliance_helpers.is_internal(request)
def get_queryset(self): # user = self.request.user if is_internal(self.request): return PhysicalArtifactType.objects.all() return PhysicalArtifactType.objects.none()
def test_func(self): return is_internal(self.request)
def get_queryset(self): # import ipdb; ipdb.set_trace() user = self.request.user if is_internal(self.request): return Artifact.objects.all() return Artifact.objects.none()
def get_queryset(self): user = self.request.user if is_internal(self.request): return Offence.objects.all() return Offence.objects.none()
def get_queryset(self): if is_internal(self.request): return CompliancePermissionGroup.objects.all() elif is_customer(self.request): return CompliancePermissionGroup.objects.none() return CompliancePermissionGroup.objects.none()
def get_queryset(self): if is_internal(self.request): return EmailUser.objects.all() return EmailUser.objects.none()