From 46ad47ecd962e9bde5fbaf4088b494ab58e052bb Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Mon, 8 Oct 2018 12:49:58 -0400 Subject: [PATCH] accept tag values in the body as well as URL The JS client passes arguments to the PUT call in the URL so we need the tags argument to the put() method. The python client passes arguments encoded in the body of the request, so we need the body argument. Merge the two sets of values so that inside the function we only have to process one list. Change-Id: I21a82321fabbe4f0d0a5db5a9db5dda8f65f21bb Signed-off-by: Doug Hellmann --- storyboard/api/v1/tags.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storyboard/api/v1/tags.py b/storyboard/api/v1/tags.py index ffaf7482..35833808 100644 --- a/storyboard/api/v1/tags.py +++ b/storyboard/api/v1/tags.py @@ -87,7 +87,7 @@ class TagsController(rest.RestController): @secure(checks.authenticated) @wsme_pecan.wsexpose(wmodels.Story, int, body=[wtypes.text]) - def put(self, story_id, tags): + def put(self, story_id, tags=[], body=[]): """Add a list of tags to a Story. Example:: @@ -100,6 +100,7 @@ class TagsController(rest.RestController): :param story_id: An id of a Story to which the tags should be added. :param tags: A list of tags to be added. """ + tags = (tags or []) + (body or []) story = stories_api.story_get( story_id, current_user=request.current_user_id)