Refactoring
This commit is contained in:
@@ -66,14 +66,14 @@ class ApplicationDeleteMixin:
|
||||
if isinstance(item, storage.BaseCollection):
|
||||
xml_answer = xml_delete(base_prefix, path, item)
|
||||
for item in item.get_all():
|
||||
hook_notification_item = \
|
||||
HookNotificationItem(HookNotificationItemTypes.DELETE, item.uid)
|
||||
hook_notification_item = HookNotificationItem(
|
||||
HookNotificationItemTypes.DELETE, item.uid)
|
||||
self._hook.notify(hook_notification_item)
|
||||
else:
|
||||
xml_answer = xml_delete(
|
||||
base_prefix, path, item.collection, item.href)
|
||||
hook_notification_item = \
|
||||
HookNotificationItem(HookNotificationItemTypes.DELETE, item.uid)
|
||||
hook_notification_item = HookNotificationItem(
|
||||
HookNotificationItemTypes.DELETE, item.uid)
|
||||
self._hook.notify(hook_notification_item)
|
||||
headers = {"Content-Type": "text/xml; charset=%s" % self._encoding}
|
||||
return client.OK, headers, self._write_xml_content(xml_answer)
|
||||
|
||||
@@ -195,8 +195,8 @@ class ApplicationPutMixin:
|
||||
etag = self._storage.create_collection(
|
||||
path, prepared_items, props).etag
|
||||
for item in prepared_items:
|
||||
hook_notification_item = \
|
||||
HookNotificationItem(HookNotificationItemTypes.UPSERT, item.serialize())
|
||||
hook_notification_item = HookNotificationItem(
|
||||
HookNotificationItemTypes.UPSERT, item.serialize())
|
||||
self._hook.notify(hook_notification_item)
|
||||
except ValueError as e:
|
||||
logger.warning(
|
||||
@@ -213,8 +213,8 @@ class ApplicationPutMixin:
|
||||
href = posixpath.basename(pathutils.strip_path(path))
|
||||
try:
|
||||
etag = parent_item.upload(href, prepared_item).etag
|
||||
hook_notification_item = \
|
||||
HookNotificationItem(HookNotificationItemTypes.UPSERT, prepared_item.serialize())
|
||||
hook_notification_item = HookNotificationItem(
|
||||
HookNotificationItemTypes.UPSERT, prepared_item.serialize())
|
||||
self._hook.notify(hook_notification_item)
|
||||
except ValueError as e:
|
||||
logger.warning(
|
||||
|
||||
Reference in New Issue
Block a user