events: only create SYSTEM_EXCEPTION event when error would've been sent to sentry
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
eaaeaccf5d
commit
6930c84425
|
@ -13,6 +13,7 @@ from authentik.core.models import User
|
|||
from authentik.events.models import Event, EventAction, Notification
|
||||
from authentik.events.signals import EventNewThread
|
||||
from authentik.events.utils import model_to_dict
|
||||
from authentik.lib.sentry import before_send
|
||||
from authentik.lib.utils.errors import exception_to_string
|
||||
|
||||
|
||||
|
@ -62,6 +63,7 @@ class AuditMiddleware:
|
|||
|
||||
if settings.DEBUG:
|
||||
return
|
||||
if before_send({}, {"exc_info": (None, exception, None)}) is not None:
|
||||
thread = EventNewThread(
|
||||
EventAction.SYSTEM_EXCEPTION,
|
||||
request,
|
||||
|
|
Reference in a new issue