mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 03:31:04 +01:00
Use get_templates() to resolve UsageView template in ModelViewSet
Missed this in the previous PR.
This commit is contained in:
parent
45202ed5a2
commit
8162224c32
@ -171,7 +171,12 @@ class ModelViewSet(ViewSet):
|
||||
}
|
||||
|
||||
def get_usage_view_kwargs(self, **kwargs):
|
||||
return {**kwargs}
|
||||
return {
|
||||
"template_name": self.get_templates(
|
||||
"usage", fallback=self.usage_view_class.template_name
|
||||
),
|
||||
**kwargs,
|
||||
}
|
||||
|
||||
def get_inspect_view_kwargs(self, **kwargs):
|
||||
return {
|
||||
|
@ -764,15 +764,6 @@ class SnippetViewSet(ModelViewSet):
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
@property
|
||||
def usage_view(self):
|
||||
return self.construct_view(
|
||||
self.usage_view_class,
|
||||
template_name=self.get_templates(
|
||||
"usage", fallback=self.usage_view_class.template_name
|
||||
),
|
||||
)
|
||||
|
||||
@property
|
||||
def revisions_view(self):
|
||||
return self.construct_view(self.revisions_view_class)
|
||||
|
Loading…
Reference in New Issue
Block a user