Skip to content

Commit

Permalink
Set dbname only once in become
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Feb 21, 2020
1 parent 712a9c5 commit 0a428ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/sdssdb/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,10 @@ def become(self, user):
'The DB may be disconnected.')

dsn_params['user'] = user
dbname = self.dbname
self.connect_from_parameters(dbname, **dsn_params)
if 'dbname' not in dsn_params:
dsn_params['dbname'] = self.dbname

self.connect_from_parameters(**dsn_params)

def become_admin(self):
"""Becomes the admin user."""
Expand Down

0 comments on commit 0a428ed

Please sign in to comment.