Opened 17 years ago

Closed 17 years ago

#4517 closed (fixed)

[patch] Incorrect URL_VALIDATOR_USER_AGENT due to DRY violation

Reported by: James Wheare <django@…> 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)

global_settings.diff (576 bytes ) - added by James Wheare <django@…> 17 years ago.
version.diff (2.9 KB ) - added by James Wheare <django@…> 17 years ago.
Moves get_version to django/init.py

Download all attachments as: .zip

Change History (7)

by James Wheare <django@…>, 17 years ago

Attachment: global_settings.diff added

comment:1 by Malcolm Tredinnick, 17 years ago

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

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.

by James Wheare <django@…>, 17 years ago

Attachment: version.diff added

Moves get_version to django/init.py

comment:2 by James Wheare <django@…>, 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 Malcolm Tredinnick, 17 years ago

Triage Stage: AcceptedReady 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 Malcolm Tredinnick, 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 Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [5451]) Fixed #4517 -- Made sure that URL_VALIDATOR_USER_AGENT includes the up-to-date
Django version number. Thanks, James Wheare.

Note: See TracTickets for help on using tickets.
Back to Top