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

Remove module-level query in datatypes/url.py #11821

Open
jacobtylerwalls opened this issue Feb 26, 2025 · 0 comments
Open

Remove module-level query in datatypes/url.py #11821

jacobtylerwalls opened this issue Feb 26, 2025 · 0 comments
Labels
Type: Bug Something isn't working

Comments

@jacobtylerwalls
Copy link
Member

Module-level queries are discouraged in the django docs since they might execute against the wrong database or cache stale data. They're supposed to emit RuntimeWarning, this one is likely not emitting that because in most cases the module is imported late, but there's no reason to expect that to always be the case, e.g. in a management command etc.

default_url_widget = Widget.objects.get(name=default_widget_name)

@jacobtylerwalls jacobtylerwalls added the Type: Bug Something isn't working label Feb 26, 2025
@jacobtylerwalls jacobtylerwalls changed the title Remove module-level query in urldatatype.py Remove module-level query in datatypes/url.py Feb 26, 2025
@chiatt chiatt added this to pipeline Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant