Django

Code

Ticket #4517 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

[patch] Incorrect URL_VALIDATOR_USER_AGENT due to DRY violation

Reported by: James Wheare <django@sparemint.com> Assigned to: adrian
Milestone: Component: Metasystem
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 1

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

global_settings.diff (0.6 kB) - added by James Wheare <django@sparemint.com> on 06/09/07 09:35:09.
version.diff (2.9 kB) - added by James Wheare <django@sparemint.com> on 06/09/07 10:09:26.
Moves get_version to django/init.py

Change History

06/09/07 09:35:09 changed by James Wheare <django@sparemint.com>

  • attachment global_settings.diff added.

06/09/07 09:49:22 changed by mtredinnick

  • needs_better_patch set to 1.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

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.

06/09/07 10:09:26 changed by James Wheare <django@sparemint.com>

  • attachment version.diff added.

Moves get_version to django/init.py

06/09/07 10:12:59 changed by James Wheare <django@sparemint.com>

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.

06/09/07 10:53:23 changed by mtredinnick

  • stage changed from Accepted to Ready for checkin.

Looks good, James. Thanks. I'll commit this in the morning (when I'm more awake and can read it again).

06/09/07 10:54:46 changed by mtredinnick

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.

06/09/07 21:00:47 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #4517 ([patch] Incorrect URL_VALIDATOR_USER_AGENT due to DRY violation)




Change Properties
Action