Tweaked loaddata command to re-use a calculated value.

Removed a dublicated call to get_public_serializer_formats which
had already populated self.serialization_formats.

Thanks to Nick Pope for review.
This commit is contained in:
Владимир Лысенко 2020-09-17 10:24:57 +02:00 committed by Carlton Gibson
parent a046bcadbe
commit b376297d6c
1 changed files with 1 additions and 1 deletions

View File

@ -232,7 +232,7 @@ class Command(BaseCommand):
fixture_name, ser_fmt, cmp_fmt = self.parse_name(fixture_label) fixture_name, ser_fmt, cmp_fmt = self.parse_name(fixture_label)
databases = [self.using, None] databases = [self.using, None]
cmp_fmts = list(self.compression_formats) if cmp_fmt is None else [cmp_fmt] cmp_fmts = list(self.compression_formats) if cmp_fmt is None else [cmp_fmt]
ser_fmts = serializers.get_public_serializer_formats() if ser_fmt is None else [ser_fmt] ser_fmts = self.serialization_formats if ser_fmt is None else [ser_fmt]
if self.verbosity >= 2: if self.verbosity >= 2:
self.stdout.write("Loading '%s' fixtures..." % fixture_name) self.stdout.write("Loading '%s' fixtures..." % fixture_name)