Commit 417e52c5 authored by Sriram Karra's avatar Sriram Karra

Use full path while trying to delete items from carddav server

This is a long standing bug that got introduced when we moved
itemid from being a full path to just the md5hash.

Fixes: https://github.com/skarra/ASynK/issues/74
parent 6abd24da
......@@ -128,13 +128,13 @@ class CDContactsFolder(Folder):
def del_itemids (self, itemids):
sess = self.get_db().session()
for href in itemids:
for itemid in itemids:
try:
sess.deleteResource(URL(url=href))
self.del_contact(href)
logging.info('Deleted CardDAV server contact %s...', href)
sess.deleteResource(URL(url=self.item_path(itemid)))
self.del_contact(itemid)
logging.info('Deleted CardDAV server contact %s...', itemid)
except HTTPError, e:
logging.error('Could not delete itemid: %s (%s)', href, e)
logging.error('Could not delete itemid: %s (%s)', itemid, e)
def item_path (self, itemid):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment