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

Fix variable naming to conform with PEP-8

Originally proposed by @ZipFile in #998
This commit is contained in:
Unrud 2020-01-12 23:32:28 +01:00
parent d3d11d0ec8
commit 6202257fc2
10 changed files with 48 additions and 49 deletions

View file

@ -30,7 +30,7 @@ from radicale.log import logger
class ApplicationMkcolMixin:
def do_MKCOL(self, environ, base_prefix, path, user):
"""Manage MKCOL request."""
permissions = self.Rights.authorized(user, path, "Ww")
permissions = self.rights.authorized(user, path, "Ww")
if not permissions:
return httputils.NOT_ALLOWED
try:
@ -53,20 +53,20 @@ class ApplicationMkcolMixin:
if (props.get("tag") and "w" not in permissions or
not props.get("tag") and "W" not in permissions):
return httputils.NOT_ALLOWED
with self.Collection.acquire_lock("w", user):
item = next(self.Collection.discover(path), None)
with self.storage.acquire_lock("w", user):
item = next(self.storage.discover(path), None)
if item:
return httputils.METHOD_NOT_ALLOWED
parent_path = pathutils.unstrip_path(
posixpath.dirname(pathutils.strip_path(path)), True)
parent_item = next(self.Collection.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.Collection.create_collection(path, props=props)
self.storage.create_collection(path, props=props)
except ValueError as e:
logger.warning(
"Bad MKCOL request on %r: %s", path, e, exc_info=True)