Еще один мелкий фикс, траблы были, если пароль от базы неверный.
This commit is contained in:
@@ -34,15 +34,16 @@ 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:
|
||||||
db.close()
|
if db:
|
||||||
|
db.close()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __set__update_version(cls, updver=0):
|
def __set__update_version(cls, updver=0):
|
||||||
|
|||||||
Reference in New Issue
Block a user