Skip to content

Commit

Permalink
Remove deprecated attributes from Responses serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
JusticeV452 committed May 14, 2024
1 parent 65ef464 commit 24f3b65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions backend/app/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
3 changes: 0 additions & 3 deletions backend/app/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ class Meta:
"income",
"education_level",
"occupation"

]


Expand All @@ -129,8 +128,6 @@ class LoknitiResponsesSerializer(serializers.ModelSerializer):
class Meta:
model = LoknitiResponses
fields = [
"respondent_no",
"election_year",
"question_var",
"response",
"responder",
Expand Down

0 comments on commit 24f3b65

Please sign in to comment.