Skip to content

Commit

Permalink
Fixes bug when trying to delete the current connected database
Browse files Browse the repository at this point in the history
When you connect you need to specify a database, since we are dropping the database we can't connect to the same database, so we use template1 to connect and run the commands.
  • Loading branch information
camilonova committed Oct 18, 2013
1 parent c98c3ff commit 04f52d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_extensions/management/commands/reset_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def handle(self, *args, **options):
elif engine in ('postgresql_psycopg2', 'postgis'):
import psycopg2 as Database # NOQA

conn_string = "dbname=%s" % database_name
conn_string = "dbname=template1"
if user:
conn_string += " user=%s" % user
if password:
Expand Down

0 comments on commit 04f52d5

Please sign in to comment.