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
fix: remove static method from TimeEntriesDao #227
  • Loading branch information
Guido Quezada committed Nov 16, 2020
commit 947f911b6cb273b3acac275e37a734e1025e909e
9 changes: 1 addition & 8 deletions time_tracker_api/time_entries/time_entries_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@


class TimeEntriesDao(CRUDDao):
@staticmethod
def current_user_id():
return current_user_id()

@abc.abstractmethod
def find_running(self):
pass
Expand All @@ -53,10 +49,7 @@ def __init__(self, repository):
CosmosDBDao.__init__(self, repository)

def check_whether_current_user_owns_item(self, data):
if (
data.owner_id is not None
and data.owner_id != self.current_user_id()
):
if data.owner_id is not None and data.owner_id != current_user_id():
raise CustomError(
HTTPStatus.FORBIDDEN,
"The current user is not the owner of this time entry",
Expand Down
1 change: 0 additions & 1 deletion time_tracker_api/time_entries/time_entries_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
from time_tracker_api.projects.projects_model import ProjectCosmosDBModel
from time_tracker_api.projects import projects_model
from time_tracker_api.database import CRUDDao, APICosmosDBDao
from time_tracker_api.security import current_user_id

container_definition = {
'id': 'time_entry',
Expand Down