From fe1704f22329f7aeb53e0079314abfa69d2b35db Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 10 Jan 2020 20:02:55 +0000 Subject: [PATCH] Fall back to POST docstring for Action description --- .../common/flask_labthings/views/docs/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/common/flask_labthings/views/docs/__init__.py b/openflexure_microscope/common/flask_labthings/views/docs/__init__.py index 9fbf4e25..f154018d 100644 --- a/openflexure_microscope/common/flask_labthings/views/docs/__init__.py +++ b/openflexure_microscope/common/flask_labthings/views/docs/__init__.py @@ -48,7 +48,9 @@ class W3CThingDescriptionResource(Resource): for key, prop in current_labthing().actions.items(): actions[key] = {} actions[key]["title"] = prop.__name__ - actions[key]["description"] = get_docstring(prop) + actions[key]["description"] = get_docstring(prop) or ( + get_docstring(prop.post) if hasattr(prop, "post") else "" + ) actions[key]["links"] = [ {"href": current_labthing().url_for(prop, _external=True)} ]