From 88496d5d371610c171997c09e928dac6cccab7ce Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Sun, 21 Jun 2015 12:36:46 -0300 Subject: [PATCH] Refactor migration base code --- legacy/scripts/migration_base.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/legacy/scripts/migration_base.py b/legacy/scripts/migration_base.py index 10196a302..9d49045f6 100644 --- a/legacy/scripts/migration_base.py +++ b/legacy/scripts/migration_base.py @@ -21,10 +21,9 @@ for s1 in name_sets: # apps include all legacy models legacy_app = apps.get_app_config('legacy') legacy_model_names = set(m.__name__ for m in legacy_app.get_models()) -all_names = set() -for s1 in name_sets: - all_names = all_names.union(s1) -assert all_names == legacy_model_names + +model_dict = {m.__name__: m for ac in appconfs for m in ac.get_models()} +assert legacy_model_names == set(model_dict.keys()) def has_primary_key(model):