mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
possible fix for add cards error
This commit is contained in:
parent
838ed803f7
commit
2a3f653d0e
1 changed files with 2 additions and 1 deletions
|
@ -739,7 +739,8 @@ priority != 0 and due < :now and spaceUntil > :now""",
|
||||||
"Add a fact to the deck. Return list of new cards."
|
"Add a fact to the deck. Return list of new cards."
|
||||||
if not fact.model:
|
if not fact.model:
|
||||||
fact.model = self.currentModel
|
fact.model = self.currentModel
|
||||||
# the session may have been cleared, so refresh model
|
# clear the session and refresh the model
|
||||||
|
self.refresh()
|
||||||
fact.model = self.s.query(Model).get(fact.model.id)
|
fact.model = self.s.query(Model).get(fact.model.id)
|
||||||
# validate
|
# validate
|
||||||
fact.assertValid()
|
fact.assertValid()
|
||||||
|
|
Loading…
Reference in a new issue