Еще один мелкий фикс, траблы были, если пароль от базы неверный.
This commit is contained in:
parent
e36915a365
commit
e252ae0cb8
@ -34,14 +34,15 @@ class Updater:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_current_fias_version(cls):
|
def get_current_fias_version(cls):
|
||||||
db = DBImpl(psycopg2, db_conf)
|
|
||||||
try:
|
try:
|
||||||
|
db = DBImpl(psycopg2, db_conf)
|
||||||
rows = db.get_rows('SELECT version FROM "CONFIG" WHERE id=0', True)
|
rows = db.get_rows('SELECT version FROM "CONFIG" WHERE id=0', True)
|
||||||
assert len(rows) > 0, "Cannot get a version"
|
assert len(rows) > 0, "Cannot get a version"
|
||||||
return rows[0]['version']
|
return rows[0]['version']
|
||||||
except:
|
except:
|
||||||
return 0
|
return 0
|
||||||
finally:
|
finally:
|
||||||
|
if db:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user