From b376297d6c2eec5dd878dee35b36bb985b723244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9B?= =?UTF-8?q?=D1=8B=D1=81=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Thu, 17 Sep 2020 10:24:57 +0200 Subject: [PATCH] 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. --- django/core/management/commands/loaddata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py index eda3d068af..4d4cdfcbb3 100644 --- a/django/core/management/commands/loaddata.py +++ b/django/core/management/commands/loaddata.py @@ -232,7 +232,7 @@ class Command(BaseCommand): fixture_name, ser_fmt, cmp_fmt = self.parse_name(fixture_label) databases = [self.using, None] 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: self.stdout.write("Loading '%s' fixtures..." % fixture_name)