Skip to content

Commit

Permalink
Release 5.11.9
Browse files Browse the repository at this point in the history
### Changelog:
- Fix(backend): Schema descriptions on actions and subpaths for Python 3.13.
  • Loading branch information
onegreyonewhite committed Nov 12, 2024
1 parent f5f98c5 commit a94d919
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion vstutils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# pylint: disable=django-not-available
__version__: str = '5.11.8'
__version__: str = '5.11.9'
2 changes: 1 addition & 1 deletion vstutils/api/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
12 changes: 6 additions & 6 deletions vstutils/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a94d919

Please sign in to comment.