Ticket #491: pgsql-nouser.patch
File pgsql-nouser.patch, 1.2 KB (added by , 19 years ago) |
---|
-
core/db/backends/postgresql.py
17 17 def cursor(self): 18 18 from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_PASSWORD, DEBUG, TIME_ZONE 19 19 if self.connection is None: 20 if DATABASE_NAME == '' or DATABASE_USER == '':20 if DATABASE_NAME == '': 21 21 from django.core.exceptions import ImproperlyConfigured 22 raise ImproperlyConfigured, "You need to specify both DATABASE_NAME and DATABASE_USER in your Django settings file." 23 conn_string = "user=%s dbname=%s" % (DATABASE_USER, DATABASE_NAME) 22 raise ImproperlyConfigured, "You need to specify the DATABASE_NAME in your Django settings file." 23 conn_string = "dbname=%s" % DATABASE_NAME 24 if DATABASE_USER: 25 conn_string = "user=%s %s" % ( DATABASE_USER, conn_string ) 24 26 if DATABASE_PASSWORD: 25 27 conn_string += " password=%s" % DATABASE_PASSWORD 26 28 if DATABASE_HOST: