diff --git a/anki/models.py b/anki/models.py index 4edc4e989..77d6cea1b 100644 --- a/anki/models.py +++ b/anki/models.py @@ -252,6 +252,7 @@ select id from cards where nid in (select id from notes where mid = ?)""", return m['flds'].remove(field) m['flds'].insert(idx, field) + m['sortf'] = idx self._updateFieldOrds(m) self.save(m) def move(fields, oldidx=oldidx): diff --git a/tests/test_sync.py b/tests/test_sync.py index dccb3b928..58c1cf42e 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -80,12 +80,11 @@ def test_sync(): assert deck1.mod == deck1.ls assert deck1._usn != origUsn # because everything was created separately it will be merged in. in - # actual use we use a full sync to ensure initial a common starting point. + # actual use, we use a full sync to ensure a common starting point. check(2) # repeating it does nothing assert client.sync() == "noChanges" - # if we bump mod time, everything is copied across again because of the - # 600 second sync leeway. but the decks should remain the same. + # if we bump mod time, the decks will sync but should remain the same. deck1.setMod() deck1.save() assert client.sync() == "success"