fix(featured-events): resolve event_type FK to name string in API response

model_to_dict() returns event_type as an integer PK; the DHS frontend
reads ev.event_type_name to show the category badge. Added
event_type_name resolution so the carousel displays e.g. "Festivals".
This commit is contained in:
2026-04-06 21:44:11 +05:30
parent 2fefdd16c9
commit a29e8d2892
2 changed files with 10 additions and 0 deletions

View File

@@ -585,6 +585,7 @@ class FeaturedEventsAPI(APIView):
event_list = []
for e in events:
data_dict = model_to_dict(e)
data_dict['event_type_name'] = e.event_type.event_type if e.event_type else ''
try:
thumb = EventImages.objects.get(event=e.id, is_primary=True)
data_dict['thumb_img'] = thumb.event_image.url