Cosmetics
This commit is contained in:
parent
d3b90506f5
commit
e63a6e0c85
@ -349,7 +349,7 @@ class Application(
|
||||
xml_declaration=True)
|
||||
return f.getvalue()
|
||||
|
||||
def _webdav_error_response(self, human_tag, status=client.CONFLICT):
|
||||
def _webdav_error_response(self, status, human_tag):
|
||||
"""Generate XML error response."""
|
||||
headers = {"Content-Type": "text/xml; charset=%s" % self._encoding}
|
||||
content = self._write_xml_content(xmlutils.webdav_error(human_tag))
|
||||
|
@ -54,7 +54,8 @@ class ApplicationMkcalendarMixin:
|
||||
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")
|
||||
return self._webdav_error_response(
|
||||
client.CONFLICT, "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)
|
||||
|
@ -76,7 +76,8 @@ class ApplicationMoveMixin:
|
||||
not to_item and
|
||||
to_collection.path != item.collection.path and
|
||||
to_collection.has_uid(item.uid)):
|
||||
return self._webdav_error_response("%s:no-uid-conflict" % (
|
||||
return self._webdav_error_response(
|
||||
client.CONFLICT, "%s:no-uid-conflict" % (
|
||||
"C" if tag == "VCALENDAR" else "CR"))
|
||||
to_href = posixpath.basename(pathutils.strip_path(to_path))
|
||||
try:
|
||||
|
@ -201,7 +201,8 @@ class ApplicationPutMixin:
|
||||
prepared_item, = prepared_items
|
||||
if (item and item.uid != prepared_item.uid or
|
||||
not item and parent_item.has_uid(prepared_item.uid)):
|
||||
return self._webdav_error_response("%s:no-uid-conflict" % (
|
||||
return self._webdav_error_response(
|
||||
client.CONFLICT, "%s:no-uid-conflict" % (
|
||||
"C" if tag == "VCALENDAR" else "CR"))
|
||||
|
||||
href = posixpath.basename(pathutils.strip_path(path))
|
||||
|
Loading…
Reference in New Issue
Block a user