Skip to content

Commit 6c2e130

Browse files
committed
feat: 👌 #196
1 parent 8ceb682 commit 6c2e130

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

time_tracker_api/time_entries/time_entries_model.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
from time_tracker_api.customers import customers_model
2121

2222
from utils.extend_model import (
23-
add_project_name_to_time_entries,
23+
add_project_info_to_time_entries,
2424
add_activity_name_to_time_entries,
2525
create_in_condition,
2626
create_custom_query_from_str,
27-
add_user_email_to_time_entries, add_customer_name_to_projects,
27+
add_user_email_to_time_entries,
2828
)
2929
from utils.time import (
3030
datetime_str,
@@ -220,17 +220,12 @@ def find_all(
220220
time_entries, "activity_id"
221221
)
222222

223-
customer_dao = customers_model.create_dao()
224-
customers = customer_dao.get_all(visible_only=False)
225-
226223
project_dao = projects_model.create_dao()
227224
projects = project_dao.get_all(
228225
custom_sql_conditions=[custom_conditions], visible_only=False
229226
)
230227

231-
add_customer_name_to_projects(projects, customers)
232-
233-
add_project_name_to_time_entries(time_entries, projects)
228+
add_project_info_to_time_entries(time_entries, projects)
234229

235230
activity_dao = activities_model.create_dao()
236231
activities = activity_dao.get_all(

time_tracker_api/time_entries/time_entries_namespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
title='Customer Name',
151151
max_length=50,
152152
description='Name of the customer the entry belongs to',
153-
example=faker.word(['development', 'QA']),
153+
example=faker.company(),
154154
),
155155
}
156156
time_entry_response_fields.update(common_fields)

utils/extend_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ def add_customer_name_to_projects(projects, customers):
1616
setattr(project, 'customer_name', customer.name)
1717

1818

19-
def add_project_name_to_time_entries(time_entries, projects):
19+
def add_project_info_to_time_entries(time_entries, projects):
2020
"""
21-
Add attribute project_name in time-entry model, based on project_id of the
21+
Add project info in time-entry model, based on project_id of the
2222
time_entry
2323
:param (list) time_entries: time_entries retrieved from time-entry repository
2424
:param (list) projects: projects retrieved from project repository

0 commit comments

Comments
 (0)