make sure we don't put suspended leeches back in the learning queue

fixes
https://anki.tenderapp.com/discussions/beta-testing/1119-anki-210-beta-38#comment_45555453
This commit is contained in:
Damien Elmes 2018-06-25 20:27:26 +10:00
parent b5e33aafac
commit c0c33a2b58

View File

@ -837,19 +837,20 @@ select id from cards where did in %s and queue = 2 and due <= ? limit ?)"""
card.lapses += 1
card.factor = max(1300, card.factor-200)
if conf['delays']:
suspended = self._checkLeech(card, conf) and card.queue == -1
if conf['delays'] and not suspended:
card.type = 3
delay = self._moveToFirstStep(card, conf)
else:
# no relearning steps
self._updateRevIvlOnFail(card, conf)
self._rescheduleAsRev(card, conf, early=False)
# need to reset the queue after rescheduling
if suspended:
card.queue = -1
delay = 0
# if suspended as a leech, nothing to do
if self._checkLeech(card, conf) and card.queue == -1:
return 0
return delay
def _lapseIvl(self, card, conf):