Skip to content

Commit

Permalink
Fix googleapis#183 When trying to send a message that is a saved draf…
Browse files Browse the repository at this point in the history
…t and has uncommitted changes, call save draft before sending.
  • Loading branch information
Alejandro Casanovas committed Feb 4, 2019
1 parent 88e1059 commit 9326786
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions O365/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,11 @@ def send(self, save_to_sent_folder=True):
if self.__is_draft and self.object_id:
url = self.build_url(
self._endpoints.get('send_draft').format(id=self.object_id))
if self._track_changes:
# there are pending changes to be committed
self.save_draft()
data = None

else:
url = self.build_url(self._endpoints.get('send_mail'))
data = {self._cc('message'): self.to_api_data()}
Expand Down

0 comments on commit 9326786

Please sign in to comment.