0
0
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:
Sage Abdullah 2023-10-05 12:27:39 +01:00 committed by Matt Westcott
parent 45202ed5a2
commit 8162224c32
2 changed files with 6 additions and 10 deletions

View File

@ -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 {

View File

@ -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)