mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
don't throw error when upgrading collection with unused models
This commit is contained in:
parent
c3aed57df5
commit
9f2cf172f9
1 changed files with 6 additions and 1 deletions
|
@ -600,7 +600,12 @@ and ord = ? limit 1""", m['id'], t['ord']):
|
|||
remove.append(t)
|
||||
del t['actv']
|
||||
for r in remove:
|
||||
d.models.remTemplate(m, r)
|
||||
try:
|
||||
d.models.remTemplate(m, r)
|
||||
except AssertionError:
|
||||
# if the model was unused this could result in all
|
||||
# templates being removed; ignore error
|
||||
pass
|
||||
d.models.save(m)
|
||||
|
||||
# Conditional templates
|
||||
|
|
Loading…
Reference in a new issue