Kaydet (Commit) 97897665 authored tarafından Adrian Holovaty's avatar Adrian Holovaty

Fixed #1311 -- manage.py sqlclear no longer assumes database connection is…

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
üst 41fac5f9
...@@ -191,8 +191,9 @@ def get_sql_delete(mod): ...@@ -191,8 +191,9 @@ def get_sql_delete(mod):
# Close database connection explicitly, in case this output is being piped # Close database connection explicitly, in case this output is being piped
# directly into a database client, to avoid locking issues. # directly into a database client, to avoid locking issues.
cursor.close() if cursor is not None:
db.db.close() cursor.close()
db.db.close()
return output[::-1] # Reverse it, to deal with table dependencies. 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)." get_sql_delete.help_doc = "Prints the DROP TABLE SQL statements for the given model module name(s)."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment