Update in the pincode-events

This commit is contained in:
Vivek
2025-12-20 01:42:25 +05:30
parent 5e4a1765de
commit 2d43d4b1e3

View File

@@ -63,10 +63,8 @@ class EventListAPI(APIView):
print(pincode)
print('*' * 100)
# pincode is optional - if not provided or 'all', return all events
if not pincode or pincode == 'all':
events = Event.objects.all().order_by('-created_date')
else:
events = Event.objects.filter(pincode=pincode).order_by('-created_date')
event_list = []