Skip to content

Commit

Permalink
2333 When checking street - check street1 and street2
Browse files Browse the repository at this point in the history
  • Loading branch information
BarVolunteering committed Jul 8, 2023
1 parent 40fd257 commit 7089b40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions anyway/widgets/widget_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pandas as pd
from flask_babel import _
from sqlalchemy import func, distinct, between
from sqlalchemy import func, distinct, between, or_

from anyway.app_and_db import db
from anyway.backend_constants import BE_CONST, LabeledCode, InjurySeverity
Expand All @@ -28,7 +28,11 @@ def get_query(table_obj, filters, start_time, end_time):
values = value
else:
values = [value]
query = query.filter((getattr(table_obj, field_name)).in_(values))

if field_name == 'street1_hebrew':
query = query.filter(or_((getattr(table_obj, 'street1_hebrew')).in_(values), (getattr(table_obj, 'street2_hebrew')).in_(values)))
else:
query = query.filter((getattr(table_obj, field_name)).in_(values))
return query


Expand Down

0 comments on commit 7089b40

Please sign in to comment.