From 432070d0fbf20b800e667012fd220ae26e3f579f Mon Sep 17 00:00:00 2001 From: Jason Pellerin Date: Thu, 14 Sep 2006 03:40:45 +0000 Subject: [PATCH] [multi-db] Fixed scoping bug that caused pending statements to execute too soon in install. git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3757 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/core/management.py b/django/core/management.py index 2404a1d404..9630eaf6bb 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -408,8 +408,8 @@ def _install(app, commit=True, initial_data=True): if not model in models_installed: new_pending = manager.install(initial_data=initial_data) created_models.append(model) - for model, statements in new_pending.items(): - pending.setdefault(model, []).extend(statements) + for dep_model, statements in new_pending.items(): + pending.setdefault(dep_model, []).extend(statements) # Execute any pending statements that were waiting for this model if model in pending: for statement in pending.pop(model):