Commit b2b503a3 authored by Kamal Dodiya's avatar Kamal Dodiya
Browse files

500 Error when problem with server

parent 1bb6403a
Pipeline #185773 failed with stages
in 1 minute and 31 seconds
...@@ -107,8 +107,11 @@ async def create_ticket_attachment(request: Request, ...@@ -107,8 +107,11 @@ async def create_ticket_attachment(request: Request,
"date" : datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") "date" : datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")
} }
email_success = await mail_manager.send_email_wtih_attachment_async(ticket_data) email_success = await mail_manager.send_email_wtih_attachment_async(ticket_data)
response = TicketResponse() if email_success:
response.success = email_success response = TicketResponse()
response.success = True
else:
response.status_code = 500
else: else:
response_payload = {"error" : {"code" : 401, "message" : error_message}} response_payload = {"error" : {"code" : 401, "message" : error_message}}
response.content = response_payload response.content = response_payload
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment