version migration fails if version is an integer
The migration 043 fails to account for the case where the version was specified as a string or version contains non-ascii characters. This breaks migration for folks that have those incorrect templatesx in their database. Change-Id: I9c2143c9d7a4d61ff41d32ee0f7b12a5640eec72 Closes-bug: 1299174
This commit is contained in:
parent
bc644814d9
commit
f91569de61
@ -44,7 +44,7 @@ def upgrade(migrate_engine):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
dt = time.strptime(version, '%Y-%m-%d')
|
dt = time.strptime(version, '%Y-%m-%d')
|
||||||
except ValueError:
|
except (TypeError, ValueError):
|
||||||
dt = None
|
dt = None
|
||||||
|
|
||||||
if dt is None or dt < patch_date:
|
if dt is None or dt < patch_date:
|
||||||
|
Loading…
Reference in New Issue
Block a user