diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 9f03014..4526c6f 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -55,11 +55,6 @@
-
-
-
-
-
diff --git a/setup.py b/setup.py
index baa3de0..589a500 100755
--- a/setup.py
+++ b/setup.py
@@ -65,7 +65,9 @@ def drf_yasg_setup(**kwargs):
try:
- import setuptools_scm
+ # noinspection PyUnresolvedReferences
+ import setuptools_scm # noqa: F401
+
drf_yasg_setup(use_scm_version=True)
except (ImportError, LookupError) as e:
if os.getenv('CI', 'false') == 'true' or os.getenv('TRAVIS', 'false') == 'true':
diff --git a/src/drf_yasg/codecs.py b/src/drf_yasg/codecs.py
index 777abac..5644943 100644
--- a/src/drf_yasg/codecs.py
+++ b/src/drf_yasg/codecs.py
@@ -121,8 +121,7 @@ class SaneYamlDumper(yaml.SafeDumper):
"""
return super(SaneYamlDumper, self).increase_indent(flow=flow, indentless=False, **kwargs)
- @staticmethod
- def represent_odict(dump, mapping, flow_style=None): # pragma: no cover
+ def represent_odict(self, mapping, flow_style=None): # pragma: no cover
"""https://gist.github.com/miracle2k/3184458
Make PyYAML output an OrderedDict.
@@ -134,22 +133,22 @@ class SaneYamlDumper(yaml.SafeDumper):
tag = YAML_MAP_TAG
value = []
node = yaml.MappingNode(tag, value, flow_style=flow_style)
- if dump.alias_key is not None:
- dump.represented_objects[dump.alias_key] = node
+ if self.alias_key is not None:
+ self.represented_objects[self.alias_key] = node
best_style = True
if hasattr(mapping, 'items'):
mapping = mapping.items()
for item_key, item_value in mapping:
- node_key = dump.represent_data(item_key)
- node_value = dump.represent_data(item_value)
+ node_key = self.represent_data(item_key)
+ node_value = self.represent_data(item_value)
if not (isinstance(node_key, yaml.ScalarNode) and not node_key.style):
best_style = False
if not (isinstance(node_value, yaml.ScalarNode) and not node_value.style):
best_style = False
value.append((node_key, node_value))
if flow_style is None:
- if dump.default_flow_style is not None:
- node.flow_style = dump.default_flow_style
+ if self.default_flow_style is not None:
+ node.flow_style = self.default_flow_style
else:
node.flow_style = best_style
return node
diff --git a/src/drf_yasg/utils.py b/src/drf_yasg/utils.py
index 44bbb67..2f7d35b 100644
--- a/src/drf_yasg/utils.py
+++ b/src/drf_yasg/utils.py
@@ -211,7 +211,7 @@ def is_list_view(path, method, view):
"""
# for ViewSets, it could be the default 'list' action, or a list_route
action = getattr(view, 'action', '')
- method = getattr(view, action, None)
+ method = getattr(view, action, None) or method
detail = getattr(method, 'detail', None)
suffix = getattr(view, 'suffix', None)
if action in ('list', 'create') or detail is False or suffix == 'List':
diff --git a/testproj/testproj/util.py b/testproj/testproj/util.py
index 6a7f127..8bf52f4 100644
--- a/testproj/testproj/util.py
+++ b/testproj/testproj/util.py
@@ -1,7 +1,4 @@
from django.contrib.staticfiles.templatetags.staticfiles import static
-from django.urls import NoReverseMatch
-from django.utils.encoding import force_text
from django.utils.functional import lazy
-
static_lazy = lazy(static, str)