Skip to content

Moving from 3.3.3 to 3.4.6 introduces "Cannot use @detail_route or @list_route decorators on method "update" as it is an existing route" #4479

@rolfvandam

Description

@rolfvandam

After updating from 3.3.3 to 3.4.6 I get the following error when I initialize my routes:

django.core.exceptions.ImproperlyConfigured: Cannot use @detail_route or @list_route decorators on method "update" as it is an existing route

The code responsible looks like this:

def get_url_patterns(app_name):
    from django.contrib.contenttypes.models import ContentType
    router = DefaultRouter()
    for ct in ContentType.objects.filter(app_label=app_name):
        Model = ct.model_class()
        router.register("editor/"+ct.model, create_view_set(Model))
    return router.urls

The viewsets are automatically generated with type and include a mixin that includes methods like these:

    @detail_route(methods=['put'])
    def update(self, request, pk=None):
    ...

What changed in 3.4.6 that might be causing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy