Skip to content

Commit cde7fdd

Browse files
authored
feat: TT-228 When-the-client-is-archived-his-projects-must-be-hidden (#283)
1 parent 460962b commit cde7fdd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

time_tracker_api/customers/customers_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from dataclasses import dataclass
1+
from dataclasses import dataclass, field
22

33
from azure.cosmos import PartitionKey
44

@@ -32,7 +32,7 @@ class CustomerCosmosDBModel(CosmosDBModel):
3232
description: str
3333
deleted: str
3434
tenant_id: str
35-
status: str
35+
status: str = field(default='active')
3636

3737
def __init__(self, data):
3838
super(CustomerCosmosDBModel, self).__init__(data) # pragma: no cover

time_tracker_api/projects/projects_model.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ def get_all(self, conditions: dict = None, **kwargs) -> list:
110110
max_count=kwargs.get('max_count', None)
111111
)
112112

113-
customers_id = [customer.id for customer in customers]
113+
customers_id = [
114+
customer.id
115+
for customer in customers
116+
if customer.status == 'active'
117+
]
114118
conditions = conditions if conditions else {}
115119
custom_condition = "c.customer_id IN {}".format(
116120
str(tuple(customers_id))

0 commit comments

Comments
 (0)