Trigger storage hook on sharing/delete with files backend
Unlike with the csv backend the files backend acquired only a reading lock which didn't trigger the storage hook.
This commit is contained in:
@@ -372,8 +372,8 @@ class Sharing(sharing.BaseSharing):
|
|||||||
if not os.path.isfile(sharing_config_file):
|
if not os.path.isfile(sharing_config_file):
|
||||||
return {"status": "not-found"}
|
return {"status": "not-found"}
|
||||||
|
|
||||||
# read content
|
# open writable so storage hook triggers
|
||||||
with self._storage.acquire_lock("r", path=sharing_config_file):
|
with self._storage.acquire_lock("w", path=sharing_config_file):
|
||||||
# read file
|
# read file
|
||||||
with open(sharing_config_file, "rb") as fb:
|
with open(sharing_config_file, "rb") as fb:
|
||||||
(version, row) = pickle.load(fb)
|
(version, row) = pickle.load(fb)
|
||||||
|
|||||||
Reference in New Issue
Block a user