mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #21267 -- Fixed E502 pep8 warnings
This commit is contained in:
@@ -126,8 +126,8 @@ class CookieTest(BaseTests, TestCase):
|
||||
messages = [
|
||||
{
|
||||
'message': Message(constants.INFO, 'Test message'),
|
||||
'message_list': [Message(constants.INFO, 'message %s') \
|
||||
for x in range(5)] + [{'another-message': \
|
||||
'message_list': [Message(constants.INFO, 'message %s')
|
||||
for x in range(5)] + [{'another-message':
|
||||
Message(constants.ERROR, 'error')}],
|
||||
},
|
||||
Message(constants.INFO, 'message %s'),
|
||||
|
||||
@@ -14,7 +14,7 @@ class CurrentSiteManager(models.Manager):
|
||||
|
||||
# If a custom name is provided, make sure the field exists on the model
|
||||
if self.__field_name is not None and self.__field_name not in field_names:
|
||||
raise ValueError("%s couldn't find a field named %s in %s." % \
|
||||
raise ValueError("%s couldn't find a field named %s in %s." %
|
||||
(self.__class__.__name__, self.__field_name, self.model._meta.object_name))
|
||||
|
||||
# Otherwise, see if there is a field called either 'site' or 'sites'
|
||||
@@ -31,7 +31,7 @@ class CurrentSiteManager(models.Manager):
|
||||
if not isinstance(field, (models.ForeignKey, models.ManyToManyField)):
|
||||
raise TypeError("%s must be a ForeignKey or ManyToManyField." %self.__field_name)
|
||||
except FieldDoesNotExist:
|
||||
raise ValueError("%s couldn't find a field named %s in %s." % \
|
||||
raise ValueError("%s couldn't find a field named %s in %s." %
|
||||
(self.__class__.__name__, self.__field_name, self.model._meta.object_name))
|
||||
self.__is_validated = True
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ class ManagementUtility(object):
|
||||
try:
|
||||
app_name = commands[subcommand]
|
||||
except KeyError:
|
||||
sys.stderr.write("Unknown command: %r\nType '%s help' for usage.\n" % \
|
||||
sys.stderr.write("Unknown command: %r\nType '%s help' for usage.\n" %
|
||||
(subcommand, self.prog_name))
|
||||
sys.exit(1)
|
||||
if isinstance(app_name, BaseCommand):
|
||||
|
||||
@@ -63,7 +63,7 @@ class Command(BaseCommand):
|
||||
field_output.append("UNIQUE")
|
||||
if f.db_index:
|
||||
unique = "UNIQUE " if f.unique else ""
|
||||
index_output.append("CREATE %sINDEX %s ON %s (%s);" % \
|
||||
index_output.append("CREATE %sINDEX %s ON %s (%s);" %
|
||||
(unique, qn('%s_%s' % (tablename, f.name)), qn(tablename),
|
||||
qn(f.name)))
|
||||
table_output.append(" ".join(field_output))
|
||||
|
||||
@@ -24,5 +24,5 @@ class Command(BaseCommand):
|
||||
# isn't installed. There's a possibility OSError would be raised
|
||||
# for some other reason, in which case this error message would be
|
||||
# inaccurate. Still, this message catches the common case.
|
||||
raise CommandError('You appear not to have the %r program installed or on your path.' % \
|
||||
raise CommandError('You appear not to have the %r program installed or on your path.' %
|
||||
connection.client.executable_name)
|
||||
|
||||
@@ -271,7 +271,7 @@ class Deserializer(base.Deserializer):
|
||||
model_identifier = node.getAttribute(attr)
|
||||
if not model_identifier:
|
||||
raise base.DeserializationError(
|
||||
"<%s> node is missing the required '%s' attribute" \
|
||||
"<%s> node is missing the required '%s' attribute"
|
||||
% (node.nodeName, attr))
|
||||
try:
|
||||
Model = models.get_model(*model_identifier.split("."))
|
||||
@@ -279,7 +279,7 @@ class Deserializer(base.Deserializer):
|
||||
Model = None
|
||||
if Model is None:
|
||||
raise base.DeserializationError(
|
||||
"<%s> node has invalid model identifier: '%s'" % \
|
||||
"<%s> node has invalid model identifier: '%s'" %
|
||||
(node.nodeName, model_identifier))
|
||||
return Model
|
||||
|
||||
|
||||
Reference in New Issue
Block a user