summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-11 20:02:13 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 06:43:10 (GMT)
commit1503b5dcc0621ed523d5c89f0773afeb3f52b931 (patch)
treee6f5fcea12af1caff51eae33334be56d297bdbea
parente157a674408cfd85a4c582a954f02dc7a1920eb8 (diff)
Sql: No need to define empty update methods
-rw-r--r--src/query.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/query.py b/src/query.py
index 03e4703..4c2c887 100644
--- a/src/query.py
+++ b/src/query.py
@@ -415,9 +415,9 @@ class PrepareDB(object):
for version in allVersions:
currentVersion = self.__currentVersion()
with Internal.db: # transaction
- getattr(
- self, 'updateToVersion%s' %
- version.replace('.', '_'))()
+ updateMethodName = 'updateToVersion{}'.format(version.replace('.', '_'))
+ if hasattr(self, updateMethodName):
+ getattr(self, updateMethodName)()
Query('UPDATE general SET schemaversion=?', (version,))
logInfo(m18n('Database %1 updated from schema %2 to %3',
Internal.db.path, currentVersion, version), showDialog=True)