Skip to content

Commit

Permalink
Correct Event as EventText in create serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Sep 24, 2024
1 parent 0c0aae5 commit ad335c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/events/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ def create(self, validated_data: dict[str, Any]) -> Event:
event = Event.objects.create(**validated_data)

if event and description:
event_text = Event.objects.create(event_id=event, description=description)
event_text = EventText.objects.create(
event_id=event, description=description
)
event.event_text = event_text

return event
Expand Down

0 comments on commit ad335c9

Please sign in to comment.