[fix] don't validate email address on receive

This commit is contained in:
Anand Doshi 2016-04-28 16:19:49 +05:30
parent 5ccfe9acd7
commit 10097bedbb
2 changed files with 2 additions and 1 deletions

View file

@ -70,7 +70,7 @@ def make(doctype=None, name=None, content=None, subject=None, sent_or_received =
def validate_email(doc):
"""Validate Email Addresses of Recipients and CC"""
if not (doc.communication_type=="Communication" and doc.communication_medium == "Email"):
if not (doc.communication_type=="Communication" and doc.communication_medium == "Email") or doc.flags.in_receive:
return
# validate recipients

View file

@ -216,6 +216,7 @@ class EmailAccount(Document):
self.set_thread(communication, email)
communication.flags.in_receive = True
communication.insert(ignore_permissions = 1)
# save attachments