routers: invalidate _urls cache on register by sebdiem · Pull Request #6407 · encode/django-rest-framework (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation1 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

sebdiem

Description

Closes #5660

Trying to register new routes on a router after having accessed the
router urls attribute leads to surprising results.
The route is added without error to the router's registry but the urls
are not updated, because they are cached in _urls.
This commit invalidates the cache after each new registration.

see encode#5660

Trying to register new routes on a router after having accessed the router urls attribute leads to surprising results. The route is added without error to the router's registry but the urls are not updated, because they are cached in _urls. This commit invalidates the cache after each new registration.

@tomchristie

pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request

Nov 17, 2020

@sebdiem

see encode#5660

Trying to register new routes on a router after having accessed the router urls attribute leads to surprising results. The route is added without error to the router's registry but the urls are not updated, because they are cached in _urls. This commit invalidates the cache after each new registration.

2 participants

@sebdiem @tomchristie