Cosmetics
This commit is contained in:
		| @@ -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,8 +76,9 @@ 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" % ( | ||||
|                     "C" if tag == "VCALENDAR" else "CR")) | ||||
|                 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: | ||||
|                 self._storage.move(item, to_collection, to_href) | ||||
|   | ||||
| @@ -201,8 +201,9 @@ 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" % ( | ||||
|                         "C" if tag == "VCALENDAR" else "CR")) | ||||
|                     return self._webdav_error_response( | ||||
|                         client.CONFLICT, "%s:no-uid-conflict" % ( | ||||
|                             "C" if tag == "VCALENDAR" else "CR")) | ||||
|  | ||||
|                 href = posixpath.basename(pathutils.strip_path(path)) | ||||
|                 try: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Unrud
					Unrud