diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-02-02 04:50:16 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-02-02 04:50:16 +0000 |
| commit | 97897665088cc02b9a7b4cc5461b7842e759d004 (patch) | |
| tree | 30407b3eb81772d7bc502efcce53f0d56408d471 | |
| parent | 41fac5f9efc278bc37264e85f464601063b7eae8 (diff) | |
Fixed #1311 -- manage.py sqlclear no longer assumes database connection is available. Thanks, jakamkon@gmail.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2224 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/management.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/core/management.py b/django/core/management.py index ce86e9959a..f53a45e96f 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -191,8 +191,9 @@ def get_sql_delete(mod): # Close database connection explicitly, in case this output is being piped # directly into a database client, to avoid locking issues. - cursor.close() - db.db.close() + if cursor is not None: + cursor.close() + db.db.close() return output[::-1] # Reverse it, to deal with table dependencies. get_sql_delete.help_doc = "Prints the DROP TABLE SQL statements for the given model module name(s)." |
