Skip to content

Commit b0a3bd5

Browse files
author
Guido Quezada
committed
fix: remove static method from TimeEntriesDao #227
1 parent 23884b3 commit b0a3bd5

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

time_tracker_api/time_entries/time_entries_dao.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131

3232

3333
class TimeEntriesDao(CRUDDao):
34-
@staticmethod
35-
def current_user_id():
36-
return current_user_id()
37-
3834
@abc.abstractmethod
3935
def find_running(self):
4036
pass
@@ -53,10 +49,7 @@ def __init__(self, repository):
5349
CosmosDBDao.__init__(self, repository)
5450

5551
def check_whether_current_user_owns_item(self, data):
56-
if (
57-
data.owner_id is not None
58-
and data.owner_id != self.current_user_id()
59-
):
52+
if data.owner_id is not None and data.owner_id != current_user_id():
6053
raise CustomError(
6154
HTTPStatus.FORBIDDEN,
6255
"The current user is not the owner of this time entry",

time_tracker_api/time_entries/time_entries_model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
from time_tracker_api.projects.projects_model import ProjectCosmosDBModel
3939
from time_tracker_api.projects import projects_model
4040
from time_tracker_api.database import CRUDDao, APICosmosDBDao
41-
from time_tracker_api.security import current_user_id
4241

4342
container_definition = {
4443
'id': 'time_entry',

0 commit comments

Comments
 (0)