Skip to content

Commit

Permalink
Merge pull request #2713 from data-for-change/2663-location-qualifica…
Browse files Browse the repository at this point in the history
…tion-bug

validate road_segment_id and road1 are numbers
  • Loading branch information
atalyaalon authored Oct 10, 2024
2 parents 3b50254 + d587ae8 commit 6da51b1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions anyway/views/news_flash/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,19 @@ def update_news_flash_qualifying(id):

newsflash_location_qualification = request.values.get("newsflash_location_qualification")
road_segment_id = request.values.get("road_segment_id")
if road_segment_id:
if road_segment_id.isdigit():
road_segment_id = int(road_segment_id)
else:
logging.error("road_segment_id is not a number")
return return_json_error(Es.BR_BAD_FIELD)
road1 = request.values.get("road1")
if road1:
if road1.isdigit():
road1 = int(road1)
else:
logging.error("road1 is not a number")
return return_json_error(Es.BR_BAD_FIELD)
yishuv_name = request.values.get("yishuv_name")
street1_hebrew = request.values.get("street1_hebrew")
newsflash_location_qualification = QUALIFICATION_TO_ENUM_VALUE[newsflash_location_qualification]
Expand Down

0 comments on commit 6da51b1

Please sign in to comment.