Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for attachment in new_attachments:
filename = attachment['filename']
content = attachment['content']
mimetype = mimetypes.guess_type(filename)
attachments.append(Attachment.create_basic(Content=content,
ContentType=
mimetype[0],
Filename=filename))
ticket_id = params.get('TicketID')
del(params["TicketID"])
dynamic_fields = []
for fields in new_dynamic_fields:
dynamic_fields.append(DynamicField(**fields))
# Pending time
if params.get("PendingTime").startswith("0001-01-01"):
del(params['PendingTime'])
else:
# Format date
PyOTRSUtils.add_pendingtime(self, client, params.get("PendingTime"), ticket_id)
del(params['PendingTime'])
other_options = params
if no_article:
# If attachment exists it will add default Article
if other_options.get("Attachments"):
del other_options["Attachments"]
dynamic_fields = list(map(lambda f: DynamicField(**f), new_dynamic_fields))
# create ticket from basics and all other params