File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -130,19 +130,13 @@ def get_default_base_name(self, viewset):
130
130
If `base_name` is not specified, attempt to automatically determine
131
131
it from the viewset.
132
132
"""
133
- # Note that `.model` attribute on views is deprecated, although we
134
- # enforce the deprecation on the view `get_serializer_class()` and
135
- # `get_queryset()` methods, rather than here.
136
- model_cls = getattr (viewset , 'model' , None )
137
133
queryset = getattr (viewset , 'queryset' , None )
138
- if model_cls is None and queryset is not None :
139
- model_cls = queryset .model
140
134
141
- assert model_cls , '`base_name` argument not specified, and could ' \
135
+ assert queryset , '`base_name` argument not specified, and could ' \
142
136
'not automatically determine the name from the viewset, as ' \
143
137
'it does not have a `.queryset` attribute.'
144
138
145
- return model_cls ._meta .object_name .lower ()
139
+ return queryset . model ._meta .object_name .lower ()
146
140
147
141
def get_routes (self , viewset ):
148
142
"""
You can’t perform that action at this time.
0 commit comments