refactor password assignment logic
This commit is contained in:
parent
a9386b7a87
commit
b7423c488e
2 changed files with 5 additions and 2 deletions
|
@ -30,7 +30,10 @@ def make_extra_environment(database, restore_connection_params=None):
|
|||
extra = dict()
|
||||
|
||||
try:
|
||||
extra['PGPASSWORD'] = restore_connection_params.get('password') or database['restore_password'] or database['password']
|
||||
if restore_connection_params:
|
||||
extra['PGPASSWORD'] = restore_connection_params.get('password') or database.get('restore_password', database['password'])
|
||||
else:
|
||||
extra['PGPASSWORD'] = database['password']
|
||||
except (AttributeError, KeyError):
|
||||
pass
|
||||
|
||||
|
|
Loading…
Reference in a new issue