policies: show more information when provider fails to resolve application
This commit is contained in:
parent
5c0ec7554b
commit
373793ce9a
|
@ -90,7 +90,7 @@ class UserManager(DjangoUserManager):
|
||||||
|
|
||||||
|
|
||||||
class User(GuardianUserMixin, AbstractUser):
|
class User(GuardianUserMixin, AbstractUser):
|
||||||
"""Custom User model to allow easier adding o f user-based settings"""
|
"""Custom User model to allow easier adding of user-based settings"""
|
||||||
|
|
||||||
uuid = models.UUIDField(default=uuid4, editable=False)
|
uuid = models.UUIDField(default=uuid4, editable=False)
|
||||||
name = models.TextField(help_text=_("User's display name."))
|
name = models.TextField(help_text=_("User's display name."))
|
||||||
|
|
|
@ -62,9 +62,11 @@ class PolicyAccessView(AccessMixin, View):
|
||||||
return self.handle_no_permission()
|
return self.handle_no_permission()
|
||||||
try:
|
try:
|
||||||
self.resolve_provider_application()
|
self.resolve_provider_application()
|
||||||
except (Application.DoesNotExist, Provider.DoesNotExist):
|
except (Application.DoesNotExist, Provider.DoesNotExist) as exc:
|
||||||
LOGGER.warning("failed to resolve application")
|
LOGGER.warning("failed to resolve application", exc=exc)
|
||||||
return self.handle_no_permission_authenticated()
|
return self.handle_no_permission_authenticated(
|
||||||
|
PolicyResult(False, _("Failed to resolve application"))
|
||||||
|
)
|
||||||
# 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:
|
||||||
|
|
|
@ -9657,7 +9657,7 @@ definitions:
|
||||||
readOnly: true
|
readOnly: true
|
||||||
readOnly: true
|
readOnly: true
|
||||||
user:
|
user:
|
||||||
description: Custom User model to allow easier adding o f user-based settings
|
description: Custom User model to allow easier adding of user-based settings
|
||||||
required:
|
required:
|
||||||
- password
|
- password
|
||||||
- username
|
- username
|
||||||
|
@ -11871,7 +11871,7 @@ definitions:
|
||||||
description: Optional fixed data to enforce on user enrollment.
|
description: Optional fixed data to enforce on user enrollment.
|
||||||
type: object
|
type: object
|
||||||
created_by:
|
created_by:
|
||||||
description: Custom User model to allow easier adding o f user-based settings
|
description: Custom User model to allow easier adding of user-based settings
|
||||||
required:
|
required:
|
||||||
- password
|
- password
|
||||||
- username
|
- username
|
||||||
|
|
Reference in New Issue