Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: TT-228 When-the-client-is-archived-his-projects-must-be-hidden
  • Loading branch information
jeffqev committed Apr 28, 2021
commit 9ac12795ed1404c75faa4433665965e65bd2d711
4 changes: 2 additions & 2 deletions time_tracker_api/customers/customers_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dataclasses import dataclass
from dataclasses import dataclass, field

from azure.cosmos import PartitionKey

Expand Down Expand Up @@ -32,7 +32,7 @@ class CustomerCosmosDBModel(CosmosDBModel):
description: str
deleted: str
tenant_id: str
status: str
status: str = field(default='active')

def __init__(self, data):
super(CustomerCosmosDBModel, self).__init__(data) # pragma: no cover
Expand Down
6 changes: 5 additions & 1 deletion time_tracker_api/projects/projects_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ def get_all(self, conditions: dict = None, **kwargs) -> list:
max_count=kwargs.get('max_count', None)
)

customers_id = [customer.id for customer in customers]
customers_id = [
customer.id
for customer in customers
if customer.status == 'active'
]
conditions = conditions if conditions else {}
custom_condition = "c.customer_id IN {}".format(
str(tuple(customers_id))
Expand Down