Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate road_segment_id and road1 are numbers #2713

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions anyway/views/news_flash/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,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
Loading