From b3937a3280624c4755f9aa51a1015d7d1e8318e9 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 28 Aug 2011 15:14:04 +0900 Subject: [PATCH] make sure currentModelId is set and css regenerated on upgrade --- anki/storage.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/anki/storage.py b/anki/storage.py index 471c53f52..6a0025906 100644 --- a/anki/storage.py +++ b/anki/storage.py @@ -477,6 +477,11 @@ order by ordinal""", mid)): def _postSchemaUpgrade(deck): "Handle the rest of the upgrade to 2.0." import anki.deck + # make sure we have a current model id + deck.conf['currentModelId'] = deck.models.models.keys()[0] + # regenerate css + for m in deck.models.all(): + deck.models.save(m) # fix creation time deck.sched._updateCutoff() d = datetime.datetime.today()