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.
pull/10900/head
Sage Abdullah 2023-09-15 10:29:17 +01:00
rodzic bc09537136
commit 47af24381e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: EB1A33CC51CC0217
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

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

Wyświetl plik

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