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