policies: improve logging
This commit is contained in:
parent
de03ed0aec
commit
743aaea15e
|
@ -6,6 +6,7 @@ from rest_framework.response import Response
|
||||||
class Pagination(pagination.PageNumberPagination):
|
class Pagination(pagination.PageNumberPagination):
|
||||||
"""Pagination which includes total pages and current page"""
|
"""Pagination which includes total pages and current page"""
|
||||||
|
|
||||||
|
page_query_param = "page"
|
||||||
page_size_query_param = "page_size"
|
page_size_query_param = "page_size"
|
||||||
|
|
||||||
def get_paginated_response(self, data):
|
def get_paginated_response(self, data):
|
||||||
|
|
|
@ -63,10 +63,12 @@ class PolicyAccessView(AccessMixin, View):
|
||||||
try:
|
try:
|
||||||
self.resolve_provider_application()
|
self.resolve_provider_application()
|
||||||
except (Application.DoesNotExist, Provider.DoesNotExist):
|
except (Application.DoesNotExist, Provider.DoesNotExist):
|
||||||
|
LOGGER.warning("failed to resolve application")
|
||||||
return self.handle_no_permission_authenticated()
|
return self.handle_no_permission_authenticated()
|
||||||
# Check if user is unauthenticated, so we pass the application
|
# Check if user is unauthenticated, so we pass the application
|
||||||
# for the identification stage
|
# for the identification stage
|
||||||
if not request.user.is_authenticated:
|
if not request.user.is_authenticated:
|
||||||
|
LOGGER.warning("user not authenticated")
|
||||||
return self.handle_no_permission()
|
return self.handle_no_permission()
|
||||||
# Check permissions
|
# Check permissions
|
||||||
result = self.user_has_access()
|
result = self.user_has_access()
|
||||||
|
|
Reference in New Issue