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 global register_schemes calls #246

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove global register_schemes calls
Modifying the global urllib.parse/urlparse uses_* variables isn't needed anymore. Most aren't used and are only left for backwards_compatibility.
Only one that could be relevant would be `uses_param` (for parsing path variables). But theses aren't used/read from the result anywhere in django-environ.
Jorrit authored Jan 13, 2020

Verified

This commit was signed with the committer’s verified signature.
d2iq-dispatch D2iQ Dispatch
commit 170880ccf204fd457a8a50116e17aae0a590fe1f
18 changes: 0 additions & 18 deletions environ/environ.py
Original file line number Diff line number Diff line change
@@ -785,21 +785,3 @@ def _absolute_join(base, *paths, **kwargs):
raise ImproperlyConfigured(
"Create required path: {0}".format(absolute_path))
return absolute_path


def register_scheme(scheme):
for method in dir(urlparselib):
if method.startswith('uses_'):
getattr(urlparselib, method).append(scheme)


def register_schemes(schemes):
for scheme in schemes:
register_scheme(scheme)


# Register database and cache schemes in URLs.
register_schemes(Env.DB_SCHEMES.keys())
register_schemes(Env.CACHE_SCHEMES.keys())
register_schemes(Env.SEARCH_SCHEMES.keys())
register_schemes(Env.EMAIL_SCHEMES.keys())