calcurse-caldav: Fix late retrieval of ETag

Fixes another regression introduced in badbd71 (calcurse-caldav: Add a
debug mode, 2016-01-23).

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer 2016-01-25 13:08:17 +01:00
parent 5abef70ee5
commit 475c341686

View File

@ -192,10 +192,10 @@ def push_object(conn, objhash):
body = calcurse_export(objhash)
headers, body = remote_query("PUT", path + objhash + ".ics", {}, body)
if not 'ETag' in headers:
if not headers:
return None
etag = headers['ETag']
etag = [header[1] for header in headers if header[0] == 'ETag'][0]
while not etag:
hrefmap = get_hrefmap(conn, objhash)
if len(hrefmap.keys()) > 0: