Skip to content

Commit d8399a4

Browse files
committed
Fix Bug #8 - Message posting with File URL isn't working
Treat files variable as an list (correct type) and ensure its contents are utf8 strings by applying the utf8 function via map.
1 parent 38d38e4 commit d8399a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ciscosparkapi/api/messages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ def create(self, roomId=None, toPersonId=None, toPersonEmail=None,
236236
if markdown:
237237
post_data[u'markdown'] = utf8(markdown)
238238
if files:
239-
post_data[u'files'] = utf8(files)
239+
files = map(utf8, files)
240+
post_data[u'files'] = files
240241
# API request
241242
json_obj = self.session.post('messages', json=post_data)
242243
# Return a Message object created from the response JSON data

0 commit comments

Comments
 (0)