mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Do not use super().get_urlpatterns in ModelViewSet and SnippetViewSet
In ModelViewSet, this doesn't do anything as the base ViewSet class returns an empty list. In SnippetViewSet, this causes the ModelViewSet's urlpatterns to be carried over, resulting in duplicate URLs that we do not want.
This commit is contained in:
parent
bc09537136
commit
47af24381e
@ -409,7 +409,7 @@ class ModelViewSet(ViewSet):
|
||||
ReferenceIndex.register_model(self.model)
|
||||
|
||||
def get_urlpatterns(self):
|
||||
return super().get_urlpatterns() + [
|
||||
return [
|
||||
path("", self.index_view, name="index"),
|
||||
path("results/", self.index_results_view, name="index_results"),
|
||||
path("new/", self.add_view, name="add"),
|
||||
|
@ -1255,7 +1255,7 @@ class SnippetViewSet(ModelViewSet):
|
||||
)
|
||||
|
||||
def get_urlpatterns(self):
|
||||
urlpatterns = super().get_urlpatterns() + [
|
||||
urlpatterns = [
|
||||
path("", self.index_view, name="list"),
|
||||
path("results/", self.index_results_view, name="list_results"),
|
||||
path("add/", self.add_view, name="add"),
|
||||
|
Loading…
Reference in New Issue
Block a user