Skip to content

routers: invalidate _urls cache on register #6407

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

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 January 17, 2019 12:49
@tomchristie tomchristie merged commit 822b85a into encode:master Jan 17, 2019
@tomchristie
Copy link
Member

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.

2 participants
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