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

routers: invalidate _urls cache on register #6407

Merged
merged 1 commit into from Jan 17, 2019

Conversation

sebdiem
Copy link
Contributor

@sebdiem sebdiem commented Jan 17, 2019

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.
@sebdiem sebdiem force-pushed the sdr/invalidate_cache_on_register branch from 3e56aa1 to 40c204b Compare Jan 17, 2019
@tomchristie tomchristie merged commit 822b85a into encode:master Jan 17, 2019
1 check passed
@tomchristie
Copy link
Member

tomchristie commented Jan 17, 2019

Thanks!

@tomchristie tomchristie added this to the 3.9.2 Release milestone Jan 17, 2019
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
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.
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

Successfully merging this pull request may close these issues.

None yet

2 participants