From 24f3b6523b1f023122cada2d2818911383a1f62a Mon Sep 17 00:00:00 2001 From: JusticeV452 <55002917+JusticeV452@users.noreply.github.com> Date: Tue, 14 May 2024 13:41:17 -0400 Subject: [PATCH] Remove deprecated attributes from Responses serializer --- backend/app/api_views.py | 4 ++-- backend/app/serializers.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/backend/app/api_views.py b/backend/app/api_views.py index 6ae9508..7502ad2 100644 --- a/backend/app/api_views.py +++ b/backend/app/api_views.py @@ -218,7 +218,7 @@ def get_responders_by_constituency(request, election_year, state_name, pc_id): if election_year == 2009: state_name = state_name.upper() responses = LoknitiResponders.objects.filter( - election_year=election_year, state_name=state_name, PC_id=pc_id) + election_year=election_year, state_name__icontains=state_name, PC_id=pc_id) serializer = LoknitiRespondersSerializer(responses, many=True) return Response(serializer.data) @@ -253,7 +253,7 @@ def get_lokniti_responses_by_constituency( responses = LoknitiResponses.objects.filter( responder__election_year=election_year, question_var=question_var, - responder__state_name=state_name, responder__PC_id=PC_id + responder__state_name__icontains=state_name, responder__PC_id=PC_id ) serializer = LoknitiResponsesSerializer(responses, many=True) diff --git a/backend/app/serializers.py b/backend/app/serializers.py index d250683..e3dfb6e 100644 --- a/backend/app/serializers.py +++ b/backend/app/serializers.py @@ -118,7 +118,6 @@ class Meta: "income", "education_level", "occupation" - ] @@ -129,8 +128,6 @@ class LoknitiResponsesSerializer(serializers.ModelSerializer): class Meta: model = LoknitiResponses fields = [ - "respondent_no", - "election_year", "question_var", "response", "responder",