diff --git a/anki/sched.py b/anki/sched.py index 4dcfff3f0..ac4c29d43 100644 --- a/anki/sched.py +++ b/anki/sched.py @@ -863,7 +863,8 @@ your short-term review workload will become.""")) "Put cards at the end of the new queue." self.col.db.execute( "update cards set type=0,queue=0,ivl=0 where id in "+ids2str(ids)) - pmax = self.col.db.scalar("select max(due) from cards where type=0") + pmax = self.col.db.scalar( + "select max(due) from cards where type=0") or 0 # takes care of mod + usn self.sortCards(ids, start=pmax+1)