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: