MCPcopy Create free account
hub / github.com/O365/python-o365 / has_attachments

Method has_attachments

O365/message.py:370–379  ·  view source on GitHub ↗

Check if the message contains attachments :type: bool

(self)

Source from the content-addressed store, hash-verified

368
369 @property
370 def has_attachments(self):
371 """ Check if the message contains attachments
372
373 :type: bool
374 """
375 if self.__has_attachments is False and self.body_type.upper() == 'HTML':
376 # test for inline attachments (Azure responds with hasAttachments=False when there are only inline attachments):
377 if any(img.get('src', '').startswith('cid:') for img in self.get_body_soup().find_all('img')):
378 self.__has_attachments = True
379 return self.__has_attachments
380
381 @property
382 def is_draft(self):

Callers

nothing calls this directly

Calls 3

get_body_soupMethod · 0.95
startswithMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected