mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
be tolerant of bad upgrade
This commit is contained in:
parent
26f3ab7b9f
commit
a15b210349
1 changed files with 3 additions and 0 deletions
|
@ -101,6 +101,9 @@ def _upgrade(col, ver):
|
||||||
for m in col.models.all():
|
for m in col.models.all():
|
||||||
m['css'] = anki.models.defaultModel['css']
|
m['css'] = anki.models.defaultModel['css']
|
||||||
for t in m['tmpls']:
|
for t in m['tmpls']:
|
||||||
|
if 'css' not in t:
|
||||||
|
# ankidroid didn't bump version
|
||||||
|
continue
|
||||||
m['css'] += "\n" + t['css'].replace(
|
m['css'] += "\n" + t['css'].replace(
|
||||||
".card ", ".card%d "%(t['ord']+1))
|
".card ", ".card%d "%(t['ord']+1))
|
||||||
del t['css']
|
del t['css']
|
||||||
|
|
Loading…
Reference in a new issue