events: fix user QuerySet being passed

This commit is contained in:
Jens Langhammer 2021-02-11 23:36:22 +01:00
parent 1afb4a7a76
commit e550216f85

View file

@ -54,7 +54,7 @@ def event_trigger_handler(event_uuid: str, trigger_name: str):
return
LOGGER.debug("e(trigger): checking if trigger applies", trigger=trigger)
user = User.objects.filter(pk=event.user.get("pk")) or get_anonymous_user()
user = User.objects.filter(pk=event.user.get("pk")).first() or get_anonymous_user()
policy_engine = PolicyEngine(trigger, user)
policy_engine.mode = PolicyEngineMode.MODE_OR
policy_engine.empty_result = False