Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rolfvandam opened this issue Sep 9, 2016 · 1 comment

Comments

@rolfvandam
Copy link

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?

@xordoquy
Copy link
Collaborator

There was a bug (#4229) in 3.3 that allowed this to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants