From 6398006749dc3177e416e1e1fe175e5d3bee4a3d Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Wed, 10 May 2017 17:55:53 +0200 Subject: [PATCH] Set wsme decorator return type to None for some delete calls This patch fixes Storyboard returning a body along with a DELETE response 204 No Content for some endpoints. Change-Id: I3d21e98d5cd737b652f001c403c827e9d2a0c197 Co-Authored-By: Matthieu Huin --- storyboard/api/v1/stories.py | 2 +- storyboard/api/v1/tasks.py | 4 ++-- storyboard/api/v1/timeline.py | 2 +- storyboard/api/v1/user_tokens.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/storyboard/api/v1/stories.py b/storyboard/api/v1/stories.py index de9a53c3..32758120 100644 --- a/storyboard/api/v1/stories.py +++ b/storyboard/api/v1/stories.py @@ -336,7 +336,7 @@ class StoriesController(rest.RestController): @decorators.db_exceptions @secure(checks.superuser) - @wsme_pecan.wsexpose(wmodels.Story, int, status_code=204) + @wsme_pecan.wsexpose(None, int, status_code=204) def delete(self, story_id): """Delete this story. This command is only available to Admin users. diff --git a/storyboard/api/v1/tasks.py b/storyboard/api/v1/tasks.py index f5ad01ed..67d0dc13 100644 --- a/storyboard/api/v1/tasks.py +++ b/storyboard/api/v1/tasks.py @@ -417,7 +417,7 @@ class TasksPrimaryController(rest.RestController): @decorators.db_exceptions @secure(checks.authenticated) - @wsme_pecan.wsexpose(wmodels.Task, int, status_code=204) + @wsme_pecan.wsexpose(None, int, status_code=204) def delete(self, task_id): """Delete this task. @@ -674,7 +674,7 @@ class TasksNestedController(rest.RestController): @decorators.db_exceptions @secure(checks.authenticated) - @wsme_pecan.wsexpose(wmodels.Task, int, int, status_code=204) + @wsme_pecan.wsexpose(None, int, int, status_code=204) def delete(self, story_id, task_id): """Delete this task. diff --git a/storyboard/api/v1/timeline.py b/storyboard/api/v1/timeline.py index 23fc4957..5e919585 100644 --- a/storyboard/api/v1/timeline.py +++ b/storyboard/api/v1/timeline.py @@ -406,7 +406,7 @@ class CommentsController(rest.RestController): @decorators.db_exceptions @secure(checks.superuser) - @wsme_pecan.wsexpose(wmodels.Comment, int, int, status_code=204) + @wsme_pecan.wsexpose(None, int, int, status_code=204) def delete(self, story_id, comment_id): """Delete an existing comment. This command is disabled by default. diff --git a/storyboard/api/v1/user_tokens.py b/storyboard/api/v1/user_tokens.py index 4b0632ee..1f8830f2 100644 --- a/storyboard/api/v1/user_tokens.py +++ b/storyboard/api/v1/user_tokens.py @@ -214,7 +214,7 @@ class UserTokensController(rest.RestController): @decorators.db_exceptions @secure(checks.authenticated) - @wsme_pecan.wsexpose(wmodels.AccessToken, int, int, status_code=204) + @wsme_pecan.wsexpose(None, int, int, status_code=204) def delete(self, user_id, access_token_id): """Deletes an access token with assigned refresh token for the given user. Admin users can delete any access tokens, regular users can only