mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
make sure deck is saved before cram, fix bug with no matching tags
This commit is contained in:
parent
dd83f7a2de
commit
50fa426058
1 changed files with 2 additions and 2 deletions
|
@ -1359,12 +1359,13 @@ day = :d""", d=yesterday)
|
||||||
ui.utils.showInfo(
|
ui.utils.showInfo(
|
||||||
_("Already cramming. Please close this deck first."))
|
_("Already cramming. Please close this deck first."))
|
||||||
return
|
return
|
||||||
|
if not self.save(required=True):
|
||||||
|
return
|
||||||
(s, ret) = ui.utils.getTag(self, self.deck, _("Tags to cram:"),
|
(s, ret) = ui.utils.getTag(self, self.deck, _("Tags to cram:"),
|
||||||
help="CramMode", tags="all")
|
help="CramMode", tags="all")
|
||||||
if not ret:
|
if not ret:
|
||||||
return
|
return
|
||||||
s = unicode(s)
|
s = unicode(s)
|
||||||
self.deck.save()
|
|
||||||
# open tmp deck
|
# open tmp deck
|
||||||
ndir = tempfile.mkdtemp(prefix="anki")
|
ndir = tempfile.mkdtemp(prefix="anki")
|
||||||
path = os.path.join(ndir, "cram.anki")
|
path = os.path.join(ndir, "cram.anki")
|
||||||
|
@ -1376,7 +1377,6 @@ day = :d""", d=yesterday)
|
||||||
e.exportInto(path)
|
e.exportInto(path)
|
||||||
if not e.exportedCards:
|
if not e.exportedCards:
|
||||||
ui.utils.showInfo(_("No cards matched the provided tags."))
|
ui.utils.showInfo(_("No cards matched the provided tags."))
|
||||||
p.finish()
|
|
||||||
return
|
return
|
||||||
if self.config['randomizeOnCram']:
|
if self.config['randomizeOnCram']:
|
||||||
n = 4
|
n = 4
|
||||||
|
|
Loading…
Reference in a new issue