Skip to content

Commit

Permalink
Fix wrong id issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shaked-hayek committed Jan 24, 2024
1 parent 71ddd9e commit bfa20c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions anyway/views/news_flash/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,10 @@ def update_news_flash_qualifying(id):
logging.error("only manual update should contain location details.")
return return_json_error(Es.BR_BAD_FIELD)
news_flash_obj = db.session.query(NewsFlash).filter(NewsFlash.id == id).first()
old_location, old_location_qualifiction = extracted_location_and_qualification(news_flash_obj)
if news_flash_obj is not None:
if news_flash_obj is None:
return Response(status=404)
else:
old_location, old_location_qualifiction = extracted_location_and_qualification(news_flash_obj)
if manual_update:
if use_road_segment:
news_flash_obj.road_segment_name = road_segment_name
Expand Down

0 comments on commit bfa20c9

Please sign in to comment.