error should be returned in todict

This commit is contained in:
Emmanuel Garette 2019-12-08 08:15:47 +01:00
parent d958b9dfad
commit 4e04082cec
2 changed files with 3 additions and 3 deletions

View file

@ -86,7 +86,7 @@ def delete_session(session_id,
cursor.close() cursor.close()
class Storage(object): class Storage:
__slots__ = ('_conn', '_cursor', 'persistent', 'session_id', 'session_name', 'created') __slots__ = ('_conn', '_cursor', 'persistent', 'session_id', 'session_name', 'created')
storage = 'sqlite3' storage = 'sqlite3'

View file

@ -873,7 +873,7 @@ class TiramisuDict:
else: else:
raise ValueError(_('only multi option can have action "add", but "{}" is not a multi').format(path)) raise ValueError(_('only multi option can have action "add", but "{}" is not a multi').format(path))
else: else:
raise ValueError(_('unknown action')) raise ValueError(_('unknown action {}').format(update['action']))
except ValueError as err: except ValueError as err:
updates_status.setdefault(path, {})[index] = [err] updates_status.setdefault(path, {})[index] = [err]
if warns != []: if warns != []:
@ -897,7 +897,7 @@ class TiramisuDict:
values = {'updates': list_keys(old_model, new_model, order, updates_status), values = {'updates': list_keys(old_model, new_model, order, updates_status),
'model': new_model} 'model': new_model}
else: else:
values = None values = updates_status
return values return values
def todict(self, def todict(self,