mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-01 11:00:13 +03:00
Handle "suffix" used in action decorator kwargs
With 0148a9f8d
you would get a TypeError when using "suffix" in an
action decorator.
This might get improved to take suffix as a keyword argument already,
defaulting to `None`.
This commit is contained in:
parent
0484d01aae
commit
cefc47890a
|
@ -154,9 +154,12 @@ def action(methods=None, detail=None, name=None, url_path=None, url_name=None, *
|
|||
func.url_name = url_name if url_name else func.__name__.replace('_', '-')
|
||||
func.kwargs = kwargs
|
||||
func.kwargs.update({
|
||||
'name': func.name,
|
||||
'description': func.__doc__ or None
|
||||
})
|
||||
if 'suffix' not in kwargs:
|
||||
func.kwargs.update({
|
||||
'name': func.name,
|
||||
})
|
||||
|
||||
return func
|
||||
return decorator
|
||||
|
|
Loading…
Reference in New Issue
Block a user