# HG changeset patch # User Goffi # Date 1556434513 -7200 # Node ID 4cd7545c4ebb4e1bd86d5ef253a79b153f5bbd07 # Parent 03a09e16bf2830771c68d2037b86e0c1479a82eb core (memory): raise PermissionError directly instead of using failureFailure, as it could not be catched correctly in every case. diff -r 03a09e16bf28 -r 4cd7545c4ebb sat/memory/memory.py --- a/sat/memory/memory.py Sun Apr 28 08:55:07 2019 +0200 +++ b/sat/memory/memory.py Sun Apr 28 08:55:13 2019 +0200 @@ -1233,18 +1233,18 @@ 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 @@ ) 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