work around huge perDay values set by other clients

sqlite was choking on the long values
This commit is contained in:
Damien Elmes 2016-01-20 20:59:56 +10:00
parent 2d408cfe68
commit ee58e651ef

View file

@ -93,6 +93,16 @@ class DeckManager(object):
def load(self, decks, dconf):
self.decks = json.loads(decks)
self.dconf = json.loads(dconf)
# set limits to within bounds
found = False
for c in self.dconf.values():
for t in ('rev', 'new'):
pd = 'perDay'
if c[t][pd] > 999999:
c[t][pd] = 999999
self.save(c)
found = True
if not found:
self.changed = False
def save(self, g=None):