Fixed #27235 -- Removed some usage of mutable default arguments.
This commit is contained in:
parent
22e303887b
commit
9027e6c8a3
|
@ -94,7 +94,7 @@ class BaseDatabaseSchemaEditor(object):
|
|||
|
||||
# Core utility functions
|
||||
|
||||
def execute(self, sql, params=[]):
|
||||
def execute(self, sql, params=()):
|
||||
"""
|
||||
Executes the given SQL statement, with optional parameters.
|
||||
"""
|
||||
|
|
|
@ -142,7 +142,7 @@ class Field(RegisterLookupMixin):
|
|||
db_index=False, rel=None, default=NOT_PROVIDED, editable=True,
|
||||
serialize=True, unique_for_date=None, unique_for_month=None,
|
||||
unique_for_year=None, choices=None, help_text='', db_column=None,
|
||||
db_tablespace=None, auto_created=False, validators=[],
|
||||
db_tablespace=None, auto_created=False, validators=(),
|
||||
error_messages=None):
|
||||
self.name = name
|
||||
self.verbose_name = verbose_name # May be set by set_attributes_from_name
|
||||
|
@ -175,7 +175,7 @@ class Field(RegisterLookupMixin):
|
|||
self.creation_counter = Field.creation_counter
|
||||
Field.creation_counter += 1
|
||||
|
||||
self._validators = validators # Store for deconstruction later
|
||||
self._validators = list(validators) # Store for deconstruction later
|
||||
|
||||
messages = {}
|
||||
for c in reversed(self.__class__.__mro__):
|
||||
|
|
|
@ -62,7 +62,7 @@ class Field(object):
|
|||
|
||||
def __init__(self, required=True, widget=None, label=None, initial=None,
|
||||
help_text='', error_messages=None, show_hidden_initial=False,
|
||||
validators=[], localize=False, disabled=False, label_suffix=None):
|
||||
validators=(), localize=False, disabled=False, label_suffix=None):
|
||||
# required -- Boolean that specifies whether the field is required.
|
||||
# True by default.
|
||||
# widget -- A Widget class, or instance of a Widget class, that should
|
||||
|
|
Loading…
Reference in New Issue