Removed trailing whitespaces in error messages.

This commit is contained in:
Mariusz Felisiak 2021-03-24 11:44:01 +01:00 committed by GitHub
parent cdd0b213a8
commit 94463aa861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -153,7 +153,7 @@ class Settings:
if (setting in tuple_settings and
not isinstance(setting_value, (list, tuple))):
raise ImproperlyConfigured("The %s setting must be a list or a tuple. " % setting)
raise ImproperlyConfigured("The %s setting must be a list or a tuple." % setting)
setattr(self, setting, setting_value)
self._explicit_settings.add(setting)

View File

@ -73,7 +73,7 @@ class Extract(TimezoneMixin, Transform):
# Passing dates to functions expecting datetimes is most likely a mistake.
if type(field) == DateField and copy.lookup_name in ('hour', 'minute', 'second'):
raise ValueError(
"Cannot extract time component '%s' from DateField '%s'. " % (copy.lookup_name, field.name)
"Cannot extract time component '%s' from DateField '%s'." % (copy.lookup_name, field.name)
)
if (
isinstance(field, DurationField) and
@ -226,13 +226,13 @@ class TruncBase(TimezoneMixin, Transform):
has_explicit_output_field = class_output_field or field.__class__ is not copy.output_field.__class__
if type(field) == DateField and (
isinstance(output_field, DateTimeField) or copy.kind in ('hour', 'minute', 'second', 'time')):
raise ValueError("Cannot truncate DateField '%s' to %s. " % (
raise ValueError("Cannot truncate DateField '%s' to %s." % (
field.name, output_field.__class__.__name__ if has_explicit_output_field else 'DateTimeField'
))
elif isinstance(field, TimeField) and (
isinstance(output_field, DateTimeField) or
copy.kind in ('year', 'quarter', 'month', 'week', 'day', 'date')):
raise ValueError("Cannot truncate TimeField '%s' to %s. " % (
raise ValueError("Cannot truncate TimeField '%s' to %s." % (
field.name, output_field.__class__.__name__ if has_explicit_output_field else 'DateTimeField'
))
return copy