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
5 changes: 1 addition & 4 deletions time_tracker_api/time_entries/time_entries_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,7 @@ def find_running(
)

function_mapper = self.get_mapper_or_dict(mapper)
try:
return function_mapper(next(result))
except StopIteration as no_result:
raise CustomError(HTTPStatus.NO_CONTENT)
return function_mapper(next(result))

def validate_data(self, data, event_context: EventContext):
start_date = data.get('start_date')
Expand Down
2 changes: 1 addition & 1 deletion time_tracker_api/time_entries/time_entries_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def post(self, id):

@ns.route('/running')
@ns.response(HTTPStatus.OK, 'The time entry that is active: currently running')
@ns.response(HTTPStatus.NO_CONTENT, 'There is no time entry running right now')
@ns.response(HTTPStatus.NOT_FOUND, 'There is no time entry running right now')
class ActiveTimeEntry(Resource):
@ns.doc('running_time_entry')
@ns.marshal_with(time_entry)
Expand Down