mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05:00
don't hard error on queue/odue issue
This commit is contained in:
parent
1a80ffa8a2
commit
4b061e8f46
1 changed files with 14 additions and 2 deletions
|
|
@ -6,6 +6,16 @@ import time
|
|||
from anki.utils import intTime, hexifyID, timestampID, joinFields
|
||||
from anki.consts import *
|
||||
|
||||
# temporary
|
||||
_warned = False
|
||||
def warn():
|
||||
global _warned
|
||||
if _warned:
|
||||
return
|
||||
import sys
|
||||
sys.stderr.write("Ignore the above, please download the fix assertion addon.")
|
||||
_warned = True
|
||||
|
||||
# Cards
|
||||
##########################################################################
|
||||
|
||||
|
|
@ -71,7 +81,8 @@ class Card(object):
|
|||
self.mod = intTime()
|
||||
self.usn = self.col.usn()
|
||||
# bug check
|
||||
assert not (self.queue == 2 and self.odue)
|
||||
if (self.queue == 2 and self.odue):
|
||||
warn()
|
||||
self.col.db.execute(
|
||||
"""
|
||||
insert or replace into cards values
|
||||
|
|
@ -99,7 +110,8 @@ insert or replace into cards values
|
|||
self.mod = intTime()
|
||||
self.usn = self.col.usn()
|
||||
# bug check
|
||||
assert not (self.queue == 2 and self.odue)
|
||||
if (self.queue == 2 and self.odue):
|
||||
warn()
|
||||
self.col.db.execute(
|
||||
"""update cards set
|
||||
mod=?, usn=?, type=?, queue=?, due=?, ivl=?, factor=?, reps=?,
|
||||
|
|
|
|||
Loading…
Reference in a new issue