Skip to content

Commit 82648f5

Browse files
author
Joel Collins
committed
Fixed how _register_view looks for view tags
1 parent d7889d0 commit 82648f5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/labthings/server/labthing.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,13 @@ def _register_view(self, app, view, *urls, endpoint=None, **kwargs):
323323
self.spec.path(**rule_to_apispec_path(flask_rule, view, self.spec))
324324

325325
# Handle resource groups listed in API spec
326-
if "actions" in getattr(view, "tags", []):
327-
self.thing_description.action(flask_rules, view)
328-
self._action_views[view.endpoint] = view
329-
if "properties" in getattr(view, "tags", []):
330-
self.thing_description.property(flask_rules, view)
331-
self._property_views[view.endpoint] = view
326+
if hasattr(view, "get_tags"):
327+
if "actions" in view.get_tags():
328+
self.thing_description.action(flask_rules, view)
329+
self._action_views[view.endpoint] = view
330+
if "properties" in view.get_tags():
331+
self.thing_description.property(flask_rules, view)
332+
self._property_views[view.endpoint] = view
332333

333334
# Event stuff
334335
def add_event(self, name, schema=None):

0 commit comments

Comments
 (0)