From ee5b8facda0e27ed543eef8351731838978751a1 Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 7 Aug 2016 17:14:47 +0200 Subject: [PATCH] Always use wrapper to lock collection Also run the hook after creation of the principal collection. --- radicale/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index ba49af5..f826281 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -284,12 +284,12 @@ class Application: if user and is_authenticated: principal_path = "/%s/" % user if self.authorized(user, principal_path, "w"): - with self.Collection.acquire_lock("r"): + with self._lock_collection("r", user): principal = next( self.Collection.discover(principal_path, depth="1"), None) if not principal: - with self.Collection.acquire_lock("w"): + with self._lock_collection("w", user): self.Collection.create_collection(principal_path) # Get content