Skip to content

Commit 9ec8aa5

Browse files
darkrydertimgraham
authored andcommitted
Fixed #24149 -- Normalized tuple settings to lists.
1 parent 570912a commit 9ec8aa5

File tree

120 files changed

+612
-616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+612
-616
lines changed

django/conf/__init__.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from django.core.exceptions import ImproperlyConfigured
1616
from django.utils.deprecation import RemovedInDjango20Warning
1717
from django.utils.functional import LazyObject, empty
18-
from django.utils import six
1918

2019
ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
2120

@@ -103,8 +102,8 @@ def __init__(self, settings_module):
103102
setting_value = getattr(mod, setting)
104103

105104
if (setting in tuple_settings and
106-
isinstance(setting_value, six.string_types)):
107-
raise ImproperlyConfigured("The %s setting must be a tuple. "
105+
not isinstance(setting_value, (list, tuple))):
106+
raise ImproperlyConfigured("The %s setting must be a list or a tuple. "
108107
"Please fix your settings." % setting)
109108
setattr(self, setting, setting_value)
110109
self._explicit_settings.add(setting)

django/conf/global_settings.py

+40-40
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
USE_ETAGS = False
2222

2323
# People who get code error notifications.
24-
# In the format (('Full Name', '[email protected]'), ('Full Name', '[email protected]'))
25-
ADMINS = ()
24+
# In the format [('Full Name', '[email protected]'), ('Full Name', '[email protected]')]
25+
ADMINS = []
2626

27-
# Tuple of IP addresses, as strings, that:
27+
# List of IP addresses, as strings, that:
2828
# * See debug comments, when DEBUG is true
2929
# * Receive x-headers
30-
INTERNAL_IPS = ()
30+
INTERNAL_IPS = []
3131

3232
# Hosts/domain names that are valid for this site.
3333
# "*" matches anything, ".example.com" matches example.com and all subdomains
@@ -47,7 +47,7 @@
4747
LANGUAGE_CODE = 'en-us'
4848

4949
# Languages we provide translations for, out of the box.
50-
LANGUAGES = (
50+
LANGUAGES = [
5151
('af', gettext_noop('Afrikaans')),
5252
('ar', gettext_noop('Arabic')),
5353
('ast', gettext_noop('Asturian')),
@@ -132,15 +132,15 @@
132132
('vi', gettext_noop('Vietnamese')),
133133
('zh-hans', gettext_noop('Simplified Chinese')),
134134
('zh-hant', gettext_noop('Traditional Chinese')),
135-
)
135+
]
136136

137137
# Languages using BiDi (right-to-left) layout
138-
LANGUAGES_BIDI = ("he", "ar", "fa", "ur")
138+
LANGUAGES_BIDI = ["he", "ar", "fa", "ur"]
139139

140140
# If you set this to False, Django will make some optimizations so as not
141141
# to load the internationalization machinery.
142142
USE_I18N = True
143-
LOCALE_PATHS = ()
143+
LOCALE_PATHS = []
144144

145145
# Settings for language cookie
146146
LANGUAGE_COOKIE_NAME = 'django_language'
@@ -197,24 +197,24 @@
197197
EMAIL_TIMEOUT = None
198198

199199
# List of strings representing installed apps.
200-
INSTALLED_APPS = ()
200+
INSTALLED_APPS = []
201201

202202
# List of locations of the template source files, in search order.
203-
TEMPLATE_DIRS = ()
203+
TEMPLATE_DIRS = []
204204

205205
# List of callables that know how to import templates from various sources.
206206
# See the comments in django/core/template/loader.py for interface
207207
# documentation.
208-
TEMPLATE_LOADERS = (
208+
TEMPLATE_LOADERS = [
209209
'django.template.loaders.filesystem.Loader',
210210
'django.template.loaders.app_directories.Loader',
211211
# 'django.template.loaders.eggs.Loader',
212-
)
212+
]
213213

214214
# List of processors used by RequestContext to populate the context.
215215
# Each one should be a callable that takes the request object as its
216216
# only parameter and returns a dictionary to add to the context.
217-
TEMPLATE_CONTEXT_PROCESSORS = (
217+
TEMPLATE_CONTEXT_PROCESSORS = [
218218
'django.contrib.auth.context_processors.auth',
219219
'django.template.context_processors.debug',
220220
'django.template.context_processors.i18n',
@@ -223,7 +223,7 @@
223223
'django.template.context_processors.tz',
224224
# 'django.template.context_processors.request',
225225
'django.contrib.messages.context_processors.messages',
226-
)
226+
]
227227

228228
# Output to use in template system for invalid (e.g. misspelled) variables.
229229
TEMPLATE_STRING_IF_INVALID = ''
@@ -251,31 +251,31 @@
251251
# that are not allowed to visit any page, systemwide. Use this for bad
252252
# robots/crawlers. Here are a few examples:
253253
# import re
254-
# DISALLOWED_USER_AGENTS = (
254+
# DISALLOWED_USER_AGENTS = [
255255
# re.compile(r'^NaverBot.*'),
256256
# re.compile(r'^EmailSiphon.*'),
257257
# re.compile(r'^SiteSucker.*'),
258258
# re.compile(r'^sohu-search')
259-
# )
260-
DISALLOWED_USER_AGENTS = ()
259+
# ]
260+
DISALLOWED_USER_AGENTS = []
261261

262262
ABSOLUTE_URL_OVERRIDES = {}
263263

264-
# Tuple of strings representing allowed prefixes for the {% ssi %} tag.
265-
# Example: ('/home/html', '/var/www')
266-
ALLOWED_INCLUDE_ROOTS = ()
264+
# List of strings representing allowed prefixes for the {% ssi %} tag.
265+
# Example: ['/home/html', '/var/www']
266+
ALLOWED_INCLUDE_ROOTS = []
267267

268268
# List of compiled regular expression objects representing URLs that need not
269269
# be reported by BrokenLinkEmailsMiddleware. Here are a few examples:
270270
# import re
271-
# IGNORABLE_404_URLS = (
271+
# IGNORABLE_404_URLS = [
272272
# re.compile(r'^/apple-touch-icon.*\.png$'),
273273
# re.compile(r'^/favicon.ico$),
274274
# re.compile(r'^/robots.txt$),
275275
# re.compile(r'^/phpmyadmin/),
276276
# re.compile(r'\.(cgi|php|pl)$'),
277-
# )
278-
IGNORABLE_404_URLS = ()
277+
# ]
278+
IGNORABLE_404_URLS = []
279279

280280
# A secret key for this particular Django installation. Used in secret-key
281281
# hashing algorithms. Set this in your settings, or Django will complain
@@ -302,10 +302,10 @@
302302
STATIC_URL = None
303303

304304
# List of upload handler classes to be applied in order.
305-
FILE_UPLOAD_HANDLERS = (
305+
FILE_UPLOAD_HANDLERS = [
306306
'django.core.files.uploadhandler.MemoryFileUploadHandler',
307307
'django.core.files.uploadhandler.TemporaryFileUploadHandler',
308-
)
308+
]
309309

310310
# Maximum size, in bytes, of a request before it will be streamed to the
311311
# file system instead of into memory.
@@ -366,30 +366,30 @@
366366
# See all available format string here:
367367
# http://docs.python.org/library/datetime.html#strftime-behavior
368368
# * Note that these format strings are different from the ones to display dates
369-
DATE_INPUT_FORMATS = (
369+
DATE_INPUT_FORMATS = [
370370
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
371371
'%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
372372
'%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
373373
'%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
374374
'%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
375-
)
375+
]
376376

377377
# Default formats to be used when parsing times from input boxes, in order
378378
# See all available format string here:
379379
# http://docs.python.org/library/datetime.html#strftime-behavior
380380
# * Note that these format strings are different from the ones to display dates
381-
TIME_INPUT_FORMATS = (
381+
TIME_INPUT_FORMATS = [
382382
'%H:%M:%S', # '14:30:59'
383383
'%H:%M:%S.%f', # '14:30:59.000200'
384384
'%H:%M', # '14:30'
385-
)
385+
]
386386

387387
# Default formats to be used when parsing dates and times from input boxes,
388388
# in order
389389
# See all available format string here:
390390
# http://docs.python.org/library/datetime.html#strftime-behavior
391391
# * Note that these format strings are different from the ones to display dates
392-
DATETIME_INPUT_FORMATS = (
392+
DATETIME_INPUT_FORMATS = [
393393
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
394394
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
395395
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -402,7 +402,7 @@
402402
'%m/%d/%y %H:%M:%S.%f', # '10/25/06 14:30:59.000200'
403403
'%m/%d/%y %H:%M', # '10/25/06 14:30'
404404
'%m/%d/%y', # '10/25/06'
405-
)
405+
]
406406

407407
# First day of week, to be used on calendars
408408
# 0 means Sunday, 1 means Monday...
@@ -453,10 +453,10 @@
453453
# List of middleware classes to use. Order is important; in the request phase,
454454
# this middleware classes will be applied in the order given, and in the
455455
# response phase the middleware will be applied in reverse order.
456-
MIDDLEWARE_CLASSES = (
456+
MIDDLEWARE_CLASSES = [
457457
'django.middleware.common.CommonMiddleware',
458458
'django.middleware.csrf.CsrfViewMiddleware',
459-
)
459+
]
460460

461461
############
462462
# SESSIONS #
@@ -508,7 +508,7 @@
508508

509509
AUTH_USER_MODEL = 'auth.User'
510510

511-
AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)
511+
AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend']
512512

513513
LOGIN_URL = '/accounts/login/'
514514

@@ -522,7 +522,7 @@
522522
# the first hasher in this list is the preferred algorithm. any
523523
# password using different algorithms will be converted automatically
524524
# upon login
525-
PASSWORD_HASHERS = (
525+
PASSWORD_HASHERS = [
526526
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
527527
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
528528
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
@@ -532,7 +532,7 @@
532532
'django.contrib.auth.hashers.UnsaltedSHA1PasswordHasher',
533533
'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',
534534
'django.contrib.auth.hashers.CryptPasswordHasher',
535-
)
535+
]
536536

537537
###########
538538
# SIGNING #
@@ -596,25 +596,25 @@
596596
############
597597

598598
# The list of directories to search for fixtures
599-
FIXTURE_DIRS = ()
599+
FIXTURE_DIRS = []
600600

601601
###############
602602
# STATICFILES #
603603
###############
604604

605605
# A list of locations of additional static files
606-
STATICFILES_DIRS = ()
606+
STATICFILES_DIRS = []
607607

608608
# The default file storage backend used during the build process
609609
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
610610

611611
# List of finder classes that know how to find static files in
612612
# various locations.
613-
STATICFILES_FINDERS = (
613+
STATICFILES_FINDERS = [
614614
'django.contrib.staticfiles.finders.FileSystemFinder',
615615
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
616616
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
617-
)
617+
]
618618

619619
##############
620620
# MIGRATIONS #

django/conf/locale/ca/formats.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616

1717
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
1818
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
19-
DATE_INPUT_FORMATS = (
19+
DATE_INPUT_FORMATS = [
2020
# '31/12/2009', '31/12/09'
2121
'%d/%m/%Y', '%d/%m/%y'
22-
)
23-
DATETIME_INPUT_FORMATS = (
22+
]
23+
DATETIME_INPUT_FORMATS = [
2424
'%d/%m/%Y %H:%M:%S',
2525
'%d/%m/%Y %H:%M:%S.%f',
2626
'%d/%m/%Y %H:%M',
2727
'%d/%m/%y %H:%M:%S',
2828
'%d/%m/%y %H:%M:%S.%f',
2929
'%d/%m/%y %H:%M',
30-
)
30+
]
3131
DECIMAL_SEPARATOR = ','
3232
THOUSAND_SEPARATOR = '.'
3333
NUMBER_GROUPING = 3

django/conf/locale/cs/formats.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616

1717
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
1818
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
19-
DATE_INPUT_FORMATS = (
19+
DATE_INPUT_FORMATS = [
2020
'%d.%m.%Y', '%d.%m.%y', # '05.01.2006', '05.01.06'
2121
'%d. %m. %Y', '%d. %m. %y', # '5. 1. 2006', '5. 1. 06'
2222
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
23-
)
23+
]
2424
# Kept ISO formats as one is in first position
25-
TIME_INPUT_FORMATS = (
25+
TIME_INPUT_FORMATS = [
2626
'%H:%M:%S', # '04:30:59'
2727
'%H.%M', # '04.30'
2828
'%H:%M', # '04:30'
29-
)
30-
DATETIME_INPUT_FORMATS = (
29+
]
30+
DATETIME_INPUT_FORMATS = [
3131
'%d.%m.%Y %H:%M:%S', # '05.01.2006 04:30:59'
3232
'%d.%m.%Y %H:%M:%S.%f', # '05.01.2006 04:30:59.000200'
3333
'%d.%m.%Y %H.%M', # '05.01.2006 04.30'
@@ -39,7 +39,7 @@
3939
'%d. %m. %Y %H:%M', # '05. 01. 2006 04:30'
4040
'%d. %m. %Y', # '05. 01. 2006'
4141
'%Y-%m-%d %H.%M', # '2006-01-05 04.30'
42-
)
42+
]
4343
DECIMAL_SEPARATOR = ','
4444
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
4545
NUMBER_GROUPING = 3

django/conf/locale/cy/formats.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
1818
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
19-
DATE_INPUT_FORMATS = (
19+
DATE_INPUT_FORMATS = [
2020
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
21-
)
22-
DATETIME_INPUT_FORMATS = (
21+
]
22+
DATETIME_INPUT_FORMATS = [
2323
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
2424
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
2525
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -32,7 +32,7 @@
3232
'%d/%m/%y %H:%M:%S.%f', # '25/10/06 14:30:59.000200'
3333
'%d/%m/%y %H:%M', # '25/10/06 14:30'
3434
'%d/%m/%y', # '25/10/06'
35-
)
35+
]
3636
DECIMAL_SEPARATOR = '.'
3737
THOUSAND_SEPARATOR = ','
3838
NUMBER_GROUPING = 3

django/conf/locale/da/formats.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

1717
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
1818
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
19-
DATE_INPUT_FORMATS = (
19+
DATE_INPUT_FORMATS = [
2020
'%d.%m.%Y', # '25.10.2006'
21-
)
22-
DATETIME_INPUT_FORMATS = (
21+
]
22+
DATETIME_INPUT_FORMATS = [
2323
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
2424
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
2525
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
26-
)
26+
]
2727
DECIMAL_SEPARATOR = ','
2828
THOUSAND_SEPARATOR = '.'
2929
NUMBER_GROUPING = 3

django/conf/locale/de/formats.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616

1717
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
1818
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
19-
DATE_INPUT_FORMATS = (
19+
DATE_INPUT_FORMATS = [
2020
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
2121
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
22-
)
23-
DATETIME_INPUT_FORMATS = (
22+
]
23+
DATETIME_INPUT_FORMATS = [
2424
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
2525
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
2626
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
2727
'%d.%m.%Y', # '25.10.2006'
28-
)
28+
]
2929
DECIMAL_SEPARATOR = ','
3030
THOUSAND_SEPARATOR = '.'
3131
NUMBER_GROUPING = 3

0 commit comments

Comments
 (0)