[hot] fix email_account

This commit is contained in:
Rushabh Mehta 2017-04-27 09:03:24 +05:30
parent b6c36a67b0
commit 9ee2f07b30
2 changed files with 7 additions and 6 deletions

View file

@ -61,7 +61,7 @@ class EmailAccount(Document):
if (not self.awaiting_password and not frappe.local.flags.in_install
and not frappe.local.flags.in_patch):
if self.password or self.smtp_server in ('127.0.0.1' or 'localhost'):
if self.password or self.smtp_server in ('127.0.0.1', 'localhost'):
if self.enable_incoming:
self.get_incoming_server()
self.no_failed = 0
@ -331,7 +331,7 @@ class EmailAccount(Document):
raise SentEmailInInbox
if email.message_id:
names = frappe.db.sql("""select distinct name from tabCommunication
names = frappe.db.sql("""select distinct name from tabCommunication
where message_id='{message_id}'
order by creation desc limit 1""".format(
message_id=email.message_id
@ -591,7 +591,7 @@ class EmailAccount(Document):
if not self.use_imap:
return
flags = frappe.db.sql("""select name, communication, uid, action from
flags = frappe.db.sql("""select name, communication, uid, action from
`tabEmail Flag Queue` where is_completed=0 and email_account='{email_account}'
""".format(email_account=self.name), as_dict=True)
@ -614,7 +614,7 @@ class EmailAccount(Document):
self.set_communication_seen_status(docnames, seen=0)
docnames = ",".join([ "'%s'"%flag.get("name") for flag in flags ])
frappe.db.sql(""" update `tabEmail Flag Queue` set is_completed=1
frappe.db.sql(""" update `tabEmail Flag Queue` set is_completed=1
where name in ({docnames})""".format(docnames=docnames))
def set_communication_seen_status(self, docnames, seen=0):
@ -622,7 +622,7 @@ class EmailAccount(Document):
if not docnames:
return
frappe.db.sql(""" update `tabCommunication` set seen={seen}
frappe.db.sql(""" update `tabCommunication` set seen={seen}
where name in ({docnames})""".format(docnames=docnames, seen=seen))
@frappe.whitelist()

View file

@ -328,6 +328,7 @@ frappe.Application = Class.extend({
if(!frappe.app.session_expired_dialog) {
var dialog = new frappe.ui.Dialog({
title: __('Session Expired'),
keep_open: true,
fields: [
{ fieldtype:'Password', fieldname:'password',
label: __('Please Enter Your Password to Continue') },
@ -369,7 +370,7 @@ frappe.Application = Class.extend({
// add backdrop
$('.modal-backdrop').css({
'opacity': 1,
'background-color': '#EBEFF2'
'background-color': '#4B4C9D'
});
}
},