From 6192b2787fa7254e0ad58da892d92db94d9c9681 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 14 Jan 2021 17:20:59 +0100 Subject: [PATCH] events: notifications: send entire event in API --- authentik/events/api/notification.py | 3 ++- swagger.yaml | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/authentik/events/api/notification.py b/authentik/events/api/notification.py index 054db3a62..d80018513 100644 --- a/authentik/events/api/notification.py +++ b/authentik/events/api/notification.py @@ -4,6 +4,7 @@ from rest_framework.fields import ReadOnlyField from rest_framework.serializers import ModelSerializer from rest_framework.viewsets import GenericViewSet +from authentik.events.api.event import EventSerializer from authentik.events.models import Notification @@ -13,7 +14,7 @@ class NotificationSerializer(ModelSerializer): body = ReadOnlyField() severity = ReadOnlyField() created = ReadOnlyField() - event = ReadOnlyField() + event = EventSerializer() class Meta: diff --git a/swagger.yaml b/swagger.yaml index 079ca7f17..db93d3103 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -7603,6 +7603,8 @@ definitions: type: integer Notification: description: Notification Serializer + required: + - event type: object properties: pk: @@ -7623,9 +7625,7 @@ definitions: type: string readOnly: true event: - title: Event - type: string - readOnly: true + $ref: '#/definitions/Event' seen: title: Seen type: boolean