Skip to content

Commit e37d347

Browse files
PabloPablo
authored andcommitted
fix: TT-220 adjustments
1 parent c966573 commit e37d347

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

commons/data_access_layer/cosmos_db.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,13 @@ def attach_context(data: dict, event_context: EventContext):
206206
"session_id": event_context.session_id,
207207
}
208208

209+
@staticmethod
210+
def validate_date_range(date_range: dict) -> bool:
211+
return 'start_date' and 'end_date' in date_range
212+
209213
@staticmethod
210214
def create_sql_date_range_filter(date_range: dict) -> str:
211-
if 'start_date' and 'end_date' in date_range:
215+
if CosmosDBRepository.validate_date_range(date_range):
212216
return """
213217
AND ((c.start_date BETWEEN @start_date AND @end_date) OR
214218
(c.end_date BETWEEN @start_date AND @end_date))
@@ -250,10 +254,10 @@ def find_all(
250254
self,
251255
event_context: EventContext,
252256
conditions: dict = None,
253-
date_range: dict = None,
257+
visible_only=True,
254258
max_count=None,
255259
offset=0,
256-
visible_only=True,
260+
date_range: dict = None,
257261
mapper: Callable = None,
258262
):
259263
conditions = conditions if conditions else {}

time_tracker_api/activities/activities_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ def find_all(
9090
self,
9191
event_context: EventContext,
9292
conditions: dict = None,
93-
max_count=0,
94-
offset=0,
9593
visible_only=True,
94+
max_count=None,
95+
offset=0,
9696
activities_id: List = None,
9797
mapper: Callable = None,
9898
):

time_tracker_api/projects/projects_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def find_all(
7272
self,
7373
event_context: EventContext,
7474
conditions: dict = None,
75+
visible_only=True,
7576
project_ids: List[str] = None,
7677
customer_ids: List[str] = None,
77-
visible_only=True,
7878
mapper: Callable = None,
7979
):
8080
params = self.generate_params(conditions) if conditions else []

0 commit comments

Comments
 (0)