Skip to content

Commit

Permalink
fix: dont create null communication
Browse files Browse the repository at this point in the history
  • Loading branch information
RitvikSardana committed Nov 22, 2024
1 parent de03eae commit a3df210
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 4 additions & 3 deletions helpdesk/api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ def create_email_account(data):
**service_config,
}
)
email_doc.append(
"imap_folder", {"append_to": "HD Ticket", "folder_name": "INBOX"}
)
if service == "Frappe Mail":
email_doc.api_key = data.get("api_key")
email_doc.api_secret = data.get("api_secret")
email_doc.frappe_mail_site = data.get("frappe_mail_site")
email_doc.append_to = "HD Ticket"
else:
email_doc.append(
"imap_folder", {"append_to": "HD Ticket", "folder_name": "INBOX"}
)
email_doc.password = data.get("password")
# validate whether the credentials are correct
email_doc.get_incoming_server()
Expand Down
3 changes: 0 additions & 3 deletions helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,6 @@ def after_insert(self):
log_ticket_activity(self.name, "created this ticket")
capture_event("ticket_created")
publish_event("helpdesk:new-ticket", {"name": self.name})
# create communication if we are not hitting the new ticket creation API
if not self.via_customer_portal:
self.create_communication_via_contact(self.description)

def on_update(self):
# flake8: noqa
Expand Down

0 comments on commit a3df210

Please sign in to comment.