From cad0d4b0e2eb34f63bfdb69aba1ef45d3794e8ae Mon Sep 17 00:00:00 2001 From: Goffi Date: Sun, 28 Apr 2019 08:55:13 +0200 Subject: [PATCH] core (memory): raise PermissionError directly instead of using failureFailure, as it could not be catched correctly in every case. --- sat/memory/memory.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sat/memory/memory.py b/sat/memory/memory.py index b9e9f6ec..f62ac54f 100644 --- a/sat/memory/memory.py +++ b/sat/memory/memory.py @@ -1233,18 +1233,18 @@ class Memory(object): perm_data = file_data[u"access"][perm] perm_type = perm_data[u"type"] except KeyError: - raise failure.Failure(exceptions.PermissionError()) + raise exceptions.PermissionError() if perm_type == C.ACCESS_TYPE_PUBLIC: continue elif perm_type == C.ACCESS_TYPE_WHITELIST: try: jids = perm_data[u"jids"] except KeyError: - raise failure.Failure(exceptions.PermissionError()) + raise exceptions.PermissionError() if peer_jid.full() in jids: continue else: - raise failure.Failure(exceptions.PermissionError()) + raise exceptions.PermissionError() else: raise exceptions.InternalError( _(u"unknown access type: {type}").format(type=perm_type) @@ -1530,7 +1530,7 @@ class Memory(object): ) def fileUpdate(self, file_id, column, update_cb): - """update a file column taking care of race condition + """Update a file column taking care of race condition access is NOT checked in this method, it must be checked beforehand @param file_id(unicode): id of the file to update