1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-01 18:18:31 +00:00

Mark attributes for internal use with underscore

This commit is contained in:
Unrud 2020-01-14 06:19:11 +01:00
parent 9b51e495ea
commit 1453c0b72c
11 changed files with 77 additions and 74 deletions

View file

@ -30,7 +30,7 @@ from radicale.log import logger
class ApplicationMkcalendarMixin:
def do_MKCALENDAR(self, environ, base_prefix, path, user):
"""Manage MKCALENDAR request."""
if not self.rights.authorized(user, path, "w"):
if not self._rights.authorized(user, path, "w"):
return httputils.NOT_ALLOWED
try:
xml_content = self.read_xml_content(environ)
@ -51,21 +51,21 @@ class ApplicationMkcalendarMixin:
except ValueError as e:
logger.warning(
"Bad MKCALENDAR request on %r: %s", path, e, exc_info=True)
with self.storage.acquire_lock("w", user):
item = next(self.storage.discover(path), None)
with self._storage.acquire_lock("w", user):
item = next(self._storage.discover(path), None)
if item:
return self.webdav_error_response(
"D", "resource-must-be-null")
parent_path = pathutils.unstrip_path(
posixpath.dirname(pathutils.strip_path(path)), True)
parent_item = next(self.storage.discover(parent_path), None)
parent_item = next(self._storage.discover(parent_path), None)
if not parent_item:
return httputils.CONFLICT
if (not isinstance(parent_item, storage.BaseCollection) or
parent_item.get_meta("tag")):
return httputils.FORBIDDEN
try:
self.storage.create_collection(path, props=props)
self._storage.create_collection(path, props=props)
except ValueError as e:
logger.warning(
"Bad MKCALENDAR request on %r: %s", path, e, exc_info=True)