Skip to content

Commit 364a37a

Browse files
authored
Merge pull request #351 from sed-sytarchuk/master
Check if the size exists before actually indexing it DLS
2 parents 29ca559 + 86c281c commit 364a37a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

atlassian/confluence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def attach_content(self, content, name, content_type='application/binary', page_
443443
path = 'rest/api/content/{page_id}/child/attachment'.format(page_id=page_id)
444444
# Check if there is already a file with the same name
445445
attachments = self.get(path=path, headers=headers, params={'filename': name})
446-
if attachments['size']:
446+
if attachments.get('size'):
447447
path = path + '/' + attachments['results'][0]['id'] + '/data'
448448
return self.post(path=path, data=data, headers=headers,
449449
files={'file': (name, content, content_type)})

0 commit comments

Comments
 (0)