Skip to content

Commit

Permalink
Fix crash with empty generator class name
Browse files Browse the repository at this point in the history
  • Loading branch information
axnsan12 committed Dec 28, 2018
1 parent 6df2362 commit 2bc9add
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/drf_yasg/management/commands/generate_swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ def get_mock_request(self, url, format, user=None):
return request

def get_schema_generator(self, generator_class_name, api_info, api_version, api_url):
generator_class = import_string(generator_class_name) or swagger_settings.DEFAULT_GENERATOR_CLASS
generator_class = swagger_settings.DEFAULT_GENERATOR_CLASS
if generator_class_name:
generator_class = import_string(generator_class_name)

return generator_class(
info=api_info,
version=api_version,
Expand Down

0 comments on commit 2bc9add

Please sign in to comment.