mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
genCards() on model change
This commit is contained in:
parent
5c5341b5e5
commit
51b70a5787
2 changed files with 4 additions and 1 deletions
|
@ -373,6 +373,7 @@ select id from notes where mid = ?)""" % " ".join(map),
|
|||
self._changeNotes(nids, newModel, fmap)
|
||||
if cmap:
|
||||
self._changeCards(nids, newModel, cmap)
|
||||
self.col.genCards(nids)
|
||||
|
||||
def _changeNotes(self, nids, newModel, map):
|
||||
d = []
|
||||
|
|
|
@ -197,12 +197,14 @@ def test_modelChange():
|
|||
deck.models.change(basic, [f.id], basic, None, map)
|
||||
f.load()
|
||||
c0.load()
|
||||
# the card was deleted
|
||||
try:
|
||||
c1.load()
|
||||
assert 0
|
||||
except TypeError:
|
||||
pass
|
||||
assert len(f.cards()) == 1
|
||||
# but we have two cards, as a new one was generated
|
||||
assert len(f.cards()) == 2
|
||||
# an unmapped field becomes blank
|
||||
assert f['Front'] == 'b123'
|
||||
assert f['Back'] == 'f'
|
||||
|
|
Loading…
Reference in a new issue