Skip to content

Commit e4f7427

Browse files
authored
Merge pull request #189 from ioet/revert-185-fix/running-return-204
Revert "fix: 🥅 return 204 when time-entry not found in running"
2 parents 67e10bb + 4e66fef commit e4f7427

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

time_tracker_api/time_entries/time_entries_model.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,7 @@ def find_running(
313313
)
314314

315315
function_mapper = self.get_mapper_or_dict(mapper)
316-
try:
317-
return function_mapper(next(result))
318-
except StopIteration as no_result:
319-
raise CustomError(HTTPStatus.NO_CONTENT)
316+
return function_mapper(next(result))
320317

321318
def validate_data(self, data, event_context: EventContext):
322319
start_date = data.get('start_date')

time_tracker_api/time_entries/time_entries_namespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def post(self, id):
292292

293293
@ns.route('/running')
294294
@ns.response(HTTPStatus.OK, 'The time entry that is active: currently running')
295-
@ns.response(HTTPStatus.NO_CONTENT, 'There is no time entry running right now')
295+
@ns.response(HTTPStatus.NOT_FOUND, 'There is no time entry running right now')
296296
class ActiveTimeEntry(Resource):
297297
@ns.doc('running_time_entry')
298298
@ns.marshal_with(time_entry)

0 commit comments

Comments
 (0)