From 85a7b7db509997fdabffded3304a333ffc78f650 Mon Sep 17 00:00:00 2001 From: Guillaume DOTT Date: Thu, 31 Jan 2013 17:09:03 +0100 Subject: [PATCH] Prevent exception in from_file when user is None --- radicale/rights/from_file.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/radicale/rights/from_file.py b/radicale/rights/from_file.py index 3dce5160..054003d0 100644 --- a/radicale/rights/from_file.py +++ b/radicale/rights/from_file.py @@ -68,7 +68,9 @@ else: def read_authorized(user, collection): """Check if the user is allowed to read the collection.""" - if owner_only.read_authorized(user, collection): + if user == None: + return False + elif owner_only.read_authorized(user, collection): return True else: try: @@ -78,7 +80,9 @@ def read_authorized(user, collection): def write_authorized(user, collection): """Check if the user is allowed to write the collection.""" - if owner_only.read_authorized(user, collection): + if user == None: + return False + elif owner_only.read_authorized(user, collection): return True else: try: