events: notifications: send entire event in API
This commit is contained in:
parent
c7d28f8ca9
commit
6192b2787f
|
@ -4,6 +4,7 @@ from rest_framework.fields import ReadOnlyField
|
||||||
from rest_framework.serializers import ModelSerializer
|
from rest_framework.serializers import ModelSerializer
|
||||||
from rest_framework.viewsets import GenericViewSet
|
from rest_framework.viewsets import GenericViewSet
|
||||||
|
|
||||||
|
from authentik.events.api.event import EventSerializer
|
||||||
from authentik.events.models import Notification
|
from authentik.events.models import Notification
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +14,7 @@ class NotificationSerializer(ModelSerializer):
|
||||||
body = ReadOnlyField()
|
body = ReadOnlyField()
|
||||||
severity = ReadOnlyField()
|
severity = ReadOnlyField()
|
||||||
created = ReadOnlyField()
|
created = ReadOnlyField()
|
||||||
event = ReadOnlyField()
|
event = EventSerializer()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
||||||
|
|
|
@ -7603,6 +7603,8 @@ definitions:
|
||||||
type: integer
|
type: integer
|
||||||
Notification:
|
Notification:
|
||||||
description: Notification Serializer
|
description: Notification Serializer
|
||||||
|
required:
|
||||||
|
- event
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
pk:
|
pk:
|
||||||
|
@ -7623,9 +7625,7 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
readOnly: true
|
readOnly: true
|
||||||
event:
|
event:
|
||||||
title: Event
|
$ref: '#/definitions/Event'
|
||||||
type: string
|
|
||||||
readOnly: true
|
|
||||||
seen:
|
seen:
|
||||||
title: Seen
|
title: Seen
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
Reference in New Issue