diff --git a/vstutils/__init__.py b/vstutils/__init__.py index 96a4b639..bea3dadb 100644 --- a/vstutils/__init__.py +++ b/vstutils/__init__.py @@ -1,2 +1,2 @@ # pylint: disable=django-not-available -__version__: str = '5.11.8' +__version__: str = '5.11.9' diff --git a/vstutils/api/actions.py b/vstutils/api/actions.py index 874bbdb3..6d39d9d2 100644 --- a/vstutils/api/actions.py +++ b/vstutils/api/actions.py @@ -404,7 +404,7 @@ def action_method(view, request, *args, **kwargs): return serializer.data action_method.__name__ = getter.__name__ if getter else self.action_kwargs['name'] - action_method.__doc__ = self.extra_actions['get'].__doc__ + action_method.__doc__ = self.extra_actions['get'].__doc__ if self.extra_actions['get'] else None resulted_action = super().__call__(action_method) def setter(setter_method): diff --git a/vstutils/api/base.py b/vstutils/api/base.py index 67e75e5f..4b7aa165 100644 --- a/vstutils/api/base.py +++ b/vstutils/api/base.py @@ -247,19 +247,19 @@ def get_description(self, path, method): method_view_obj = method_view() action = path.split('/')[-2] submethod = getattr(method_view, action, None) - if submethod.__doc__: + if submethod is not None and submethod.__doc__: return str(submethod.__doc__).strip() # nocv if method == 'GET' and '{' not in path[:-1].split('/')[-1]: action = 'list' - elif method == 'POST': # nocv + elif method == 'POST': action = 'create' - elif method == 'GET': # nocv + elif method == 'GET': action = 'retrieve' - elif method == 'PUT': # nocv + elif method == 'PUT': action = 'update' - elif method == 'PATCH': # nocv + elif method == 'PATCH': action = 'partial_update' - elif method == 'DELETE': # nocv + elif method == 'DELETE': action = 'destroy' method_view_obj.action = action if method_view_obj.schema is None: