mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Prevent exception in from_file when user is None
This commit is contained in:
parent
bcdf00f85e
commit
85a7b7db50
1 changed files with 6 additions and 2 deletions
|
@ -68,7 +68,9 @@ else:
|
||||||
|
|
||||||
def read_authorized(user, collection):
|
def read_authorized(user, collection):
|
||||||
"""Check if the user is allowed to read the 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
|
return True
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
@ -78,7 +80,9 @@ def read_authorized(user, collection):
|
||||||
|
|
||||||
def write_authorized(user, collection):
|
def write_authorized(user, collection):
|
||||||
"""Check if the user is allowed to write the 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
|
return True
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue