make sure we don't 'fix' req for cloze type

This commit is contained in:
Damien Elmes 2013-11-13 16:49:49 +09:00
parent ef9157a8ee
commit c3300f733a

View file

@ -694,12 +694,12 @@ select id from notes where mid not in """ + ids2str(self.models.ids()))
self.remNotes(ids) self.remNotes(ids)
# for each model # for each model
for m in self.models.all(): for m in self.models.all():
if m['type'] == MODEL_STD:
# model with missing req specification # model with missing req specification
if 'req' not in m: if 'req' not in m:
self.models._updateRequired(m) self.models._updateRequired(m)
problems.append(_("Fixed note type: %s") % m['name']) problems.append(_("Fixed note type: %s") % m['name'])
# cards with invalid ordinal # cards with invalid ordinal
if m['type'] == MODEL_STD:
ids = self.db.list(""" ids = self.db.list("""
select id from cards where ord not in %s and nid in ( select id from cards where ord not in %s and nid in (
select id from notes where mid = ?)""" % select id from notes where mid = ?)""" %