[fix] [minor] on_communication, when checking if system user, extract email id and then check

This commit is contained in:
Anand Doshi
2013-09-04 18:14:20 +05:30
parent fd5b5c187a
commit 7b044da0e3
4 changed files with 8 additions and 7 deletions

View File

@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import webnotes
from utilities.transaction_base import TransactionBase
from webnotes.utils import extract_email_id
class DocType(TransactionBase):
def __init__(self, d, dl):
@@ -15,7 +16,7 @@ class DocType(TransactionBase):
return webnotes.conn.get_value('Jobs Email Settings',None,'email_id')
def on_communication(self, comm):
if webnotes.conn.get_value("Profile", comm.sender, "user_type")=="System User":
if webnotes.conn.get_value("Profile", extract_email_id(comm.sender), "user_type")=="System User":
status = "Replied"
else:
status = "Open"