Skip to content

Commit 7400b90

Browse files
kevinjlopePablo
authored andcommitted
fix: TT-220 Correction in get_all function for projects_model
1 parent 6399ba6 commit 7400b90

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

time_tracker_api/projects/projects_model.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,20 @@ def get_all(
118118
for customer in customers
119119
if customer.status == 'active'
120120
]
121+
121122
conditions = conditions if conditions else {}
122-
customers_ids = [v for k, v in conditions.items()]
123-
customers_ids = (
124-
customers_ids + customers_id if project_ids else customers_ids
123+
customers_ids_conditions = [v for k, v in conditions.items()]
124+
125+
customers_ids_conditions = (
126+
customers_ids_conditions + customers_id
127+
if customers_id
128+
else customers_id
125129
)
126130

127131
projects = self.repository.find_all(
128132
event_context=event_ctx,
129133
project_ids=project_ids,
130-
customer_ids=customers_ids,
134+
customer_ids=customers_ids_conditions,
131135
)
132136

133137
add_customer_name_to_projects(projects, customers)

0 commit comments

Comments
 (0)