Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #4517 -- Made sure that URL_VALIDATOR_USER_AGENT includes the u…

…p-to-date

Django version number. Thanks, James Wheare.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5451 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 130c7eee8058847083ad58f1f9abdcf51e879032 1 parent 6fc10f5
Malcolm Tredinnick authored
1  AUTHORS
@@ -234,6 +234,7 @@ answer newbie questions, and generally made Django that much better:
234 234
     wangchun <yaohua2000@gmail.com>
235 235
     Dan Watson <http://theidioteque.net/>
236 236
     Chris Wesseling <Chris.Wesseling@cwi.nl>
  237
+    James Wheare <django@sparemint.com>
237 238
     charly.wilhelm@gmail.com
238 239
     Rachel Willmer <http://www.willmer.com/kb/>
239 240
     Gary Wilson <gary.wilson@gmail.com>
7  django/__init__.py
... ...
@@ -1 +1,8 @@
1 1
 VERSION = (0, 97, 'pre')
  2
+
  3
+def get_version():
  4
+    "Returns the version as a human-format string."
  5
+    v = '.'.join([str(i) for i in VERSION[:-1]])
  6
+    if VERSION[-1]:
  7
+        v += '-' + VERSION[-1]
  8
+    return v
3  django/conf/global_settings.py
@@ -241,7 +241,8 @@
241 241
 
242 242
 # The User-Agent string to use when checking for URL validity through the
243 243
 # isExistingURL validator.
244  
-URL_VALIDATOR_USER_AGENT = "Django/0.96pre (http://www.djangoproject.com)"
  244
+from django import get_version
  245
+URL_VALIDATOR_USER_AGENT = "Django/%s (http://www.djangoproject.com)" % get_version()
245 246
 
246 247
 ##############
247 248
 # MIDDLEWARE #
13  django/core/management.py
@@ -3,14 +3,17 @@
3 3
 
4 4
 import django
5 5
 from django.core.exceptions import ImproperlyConfigured
6  
-import os, re, shutil, sys, textwrap
7 6
 from optparse import OptionParser
8 7
 from django.utils import termcolors
  8
+import os, re, shutil, sys, textwrap
9 9
 
10 10
 # For Python 2.3
11 11
 if not hasattr(__builtins__, 'set'):
12 12
     from sets import Set as set
13 13
 
  14
+# For backwards compatibility: get_version() used to be in this module.
  15
+get_version = django.get_version
  16
+
14 17
 MODULE_TEMPLATE = '''    {%% if perms.%(app)s.%(addperm)s or perms.%(app)s.%(changeperm)s %%}
15 18
     <tr>
16 19
         <th>{%% if perms.%(app)s.%(changeperm)s %%}<a href="%(app)s/%(mod)s/">{%% endif %%}%(name)s{%% if perms.%(app)s.%(changeperm)s %%}</a>{%% endif %%}</th>
@@ -93,14 +96,6 @@ def _get_sequence_list():
93 96
 # field as the field to which it points.
94 97
 get_rel_data_type = lambda f: (f.get_internal_type() in ('AutoField', 'PositiveIntegerField', 'PositiveSmallIntegerField')) and 'IntegerField' or f.get_internal_type()
95 98
 
96  
-def get_version():
97  
-    "Returns the version as a human-format string."
98  
-    from django import VERSION
99  
-    v = '.'.join([str(i) for i in VERSION[:-1]])
100  
-    if VERSION[-1]:
101  
-        v += '-' + VERSION[-1]
102  
-    return v
103  
-
104 99
 def get_sql_create(app):
105 100
     "Returns a list of the CREATE TABLE SQL statements for the given app."
106 101
     from django.db import get_creation_module, models

0 notes on commit 130c7ee

Please sign in to comment.
Something went wrong with that request. Please try again.