email/receive, support ticket fix
This commit is contained in:
parent
601199db6e
commit
14dac24e81
@ -90,10 +90,8 @@ class SupportMailbox(POP3Mailbox):
|
|||||||
st.doc.save()
|
st.doc.save()
|
||||||
|
|
||||||
update_feed(st.doc, 'on_update')
|
update_feed(st.doc, 'on_update')
|
||||||
webnotes.conn.commit()
|
|
||||||
# extract attachments
|
# extract attachments
|
||||||
self.save_attachments(st.doc, mail.attachments)
|
self.save_attachments(st.doc, mail.attachments)
|
||||||
webnotes.conn.begin()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
from webnotes.model.doctype import get_property
|
from webnotes.model.doctype import get_property
|
||||||
@ -124,10 +122,8 @@ class SupportMailbox(POP3Mailbox):
|
|||||||
if "MAILER-DAEMON" not in d.raised_by:
|
if "MAILER-DAEMON" not in d.raised_by:
|
||||||
self.send_auto_reply(d)
|
self.send_auto_reply(d)
|
||||||
|
|
||||||
webnotes.conn.commit()
|
|
||||||
# extract attachments
|
# extract attachments
|
||||||
self.save_attachments(d, mail.attachments)
|
self.save_attachments(d, mail.attachments)
|
||||||
webnotes.conn.begin()
|
|
||||||
|
|
||||||
|
|
||||||
def save_attachments(self, doc, attachment_list=[]):
|
def save_attachments(self, doc, attachment_list=[]):
|
||||||
@ -139,14 +135,12 @@ class SupportMailbox(POP3Mailbox):
|
|||||||
"""
|
"""
|
||||||
from webnotes.utils.file_manager import save_file, add_file_list
|
from webnotes.utils.file_manager import save_file, add_file_list
|
||||||
for attachment in attachment_list:
|
for attachment in attachment_list:
|
||||||
webnotes.conn.begin()
|
|
||||||
fid = save_file(attachment['filename'], attachment['content'], 'Support')
|
fid = save_file(attachment['filename'], attachment['content'], 'Support')
|
||||||
status = add_file_list('Support Ticket', doc.name, attachment['filename'], fid)
|
status = add_file_list('Support Ticket', doc.name, attachment['filename'], fid)
|
||||||
if not status:
|
if not status:
|
||||||
doc.description = doc.description \
|
doc.description = doc.description \
|
||||||
+ "\nCould not attach: " + cstr(attachment['filename'])
|
+ "\nCould not attach: " + cstr(attachment['filename'])
|
||||||
doc.save()
|
doc.save()
|
||||||
webnotes.conn.commit()
|
|
||||||
|
|
||||||
|
|
||||||
def send_auto_reply(self, d):
|
def send_auto_reply(self, d):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user