Skip to content

Commit

Permalink
slightly improve condition for kwargs forwarding #1075
Browse files Browse the repository at this point in the history
  • Loading branch information
tfranzel committed Dec 11, 2023
1 parent 38507c6 commit 3aba75c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drf_spectacular/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ def get_allowed_methods(self, callback):
else:
# pass to constructor allowed method names to get valid ones
kwargs = {}
http_method_names = callback.initkwargs.get('http_method_names', [])
if http_method_names:
kwargs['http_method_names'] = http_method_names
if 'http_method_names' in callback.initkwargs:
kwargs['http_method_names'] = callback.initkwargs['http_method_names']

methods = callback.cls(**kwargs).allowed_methods

Expand Down

0 comments on commit 3aba75c

Please sign in to comment.