Skip to content

Commit

Permalink
Fixed #62 -- Connection not work on non-default firebird port
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirobaina committed Jul 4, 2016
1 parent 1e1c503 commit 30621f3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions firebird/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,13 @@ def get_connection_params(self):
"settings.DATABASES is improperly configured. "
"Please supply the NAME value.")

conn_params = {'charset': 'UTF8'}
conn_params['dsn'] = settings_dict['NAME']
if settings_dict['HOST']:
conn_params['dsn'] = ('%s:%s') % (settings_dict['HOST'], conn_params['dsn'])
# The port param is not used by fdb. It must be setting by dsn string
if settings_dict['PORT']:
conn_params['port'] = settings_dict['PORT']
dsn = '%(HOST)s/%(PORT)s:%(NAME)s'
else:
dsn = '%(HOST)s:%(NAME)s'
conn_params = {'charset': 'UTF8'}
conn_params['dsn'] = dsn % settings_dict
if settings_dict['USER']:
conn_params['user'] = settings_dict['USER']
if settings_dict['PASSWORD']:
Expand Down

0 comments on commit 30621f3

Please sign in to comment.