flows: fix FlowNonApplicableException not being Sentry Ignored
This commit is contained in:
parent
2798a3edc9
commit
55bcc254c1
|
@ -1,9 +1,11 @@
|
||||||
"""flow exceptions"""
|
"""flow exceptions"""
|
||||||
|
|
||||||
|
from authentik.lib.sentry import SentryIgnoredException
|
||||||
|
|
||||||
class FlowNonApplicableException(BaseException):
|
|
||||||
|
class FlowNonApplicableException(SentryIgnoredException):
|
||||||
"""Flow does not apply to current user (denied by policy)."""
|
"""Flow does not apply to current user (denied by policy)."""
|
||||||
|
|
||||||
|
|
||||||
class EmptyFlowException(BaseException):
|
class EmptyFlowException(SentryIgnoredException):
|
||||||
"""Flow has no stages."""
|
"""Flow has no stages."""
|
||||||
|
|
|
@ -120,7 +120,7 @@ class FlowPlanner:
|
||||||
engine.build()
|
engine.build()
|
||||||
result = engine.result
|
result = engine.result
|
||||||
if not result.passing:
|
if not result.passing:
|
||||||
raise FlowNonApplicableException(result.messages)
|
raise FlowNonApplicableException(",".join(result.messages))
|
||||||
# User is passing so far, check if we have a cached plan
|
# User is passing so far, check if we have a cached plan
|
||||||
cached_plan_key = cache_key(self.flow, user)
|
cached_plan_key = cache_key(self.flow, user)
|
||||||
cached_plan = cache.get(cached_plan_key, None)
|
cached_plan = cache.get(cached_plan_key, None)
|
||||||
|
|
Reference in New Issue