Opened 17 years ago
Closed 17 years ago
#4517 closed (fixed)
[patch] Incorrect URL_VALIDATOR_USER_AGENT due to DRY violation
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Metasystem | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
Patch for django.conf.global_settings.py that keeps the URL_VALIDATOR_USER_AGENT setting string in line with the Django version number.
Attachments (2)
Change History (7)
by , 17 years ago
Attachment: | global_settings.diff added |
---|
comment:1 by , 17 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 17 years ago
Trac seems to munge the diff a bit (take a look at the original format), and I'm not sure if it's better to import django then call django.get_version() or import the method directly, but here's a stab.
comment:3 by , 17 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Looks good, James. Thanks. I'll commit this in the morning (when I'm more awake and can read it again).
comment:4 by , 17 years ago
Hmmm... note to self: we should import get_version into the namespace of management.py so that any existing code doing from management import get_version
will continue to work. I'll fix that when I commit.
comment:5 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Having the settings file import anything even slightly complex (like management.py) is probably a bit risky, since if any other module is imported indirectly that uses settings, they can't be changed any longer.
So the idea is correct, but we should do the version compositing some other way. Pushing get_version into
django/__init__.py
might be better.