From c2d0f8c084456b5073252a91eeb09ab3d7453b18 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Thu, 4 Jan 2018 04:37:23 +0500 Subject: [PATCH] Simplified an iterator in core.serializers.sort_dependencies(). Follow up to acc8dd4142ec81def9a73507120c0262ba6b1264. --- django/core/serializers/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/core/serializers/__init__.py b/django/core/serializers/__init__.py index 3406572b76..4b0ae078e2 100644 --- a/django/core/serializers/__init__.py +++ b/django/core/serializers/__init__.py @@ -216,7 +216,7 @@ def sort_dependencies(app_list): # If all of the models in the dependency list are either already # on the final model list, or not on the original serialization list, # then we've found another model with all it's dependencies satisfied. - if all(candidate for candidate in ((d not in models or d in model_list) for d in deps)): + if all(d not in models or d in model_list for d in deps): model_list.append(model) changed = True else: