Email settings check on save

This commit is contained in:
Anand Doshi 2012-01-30 11:54:59 +05:30
parent d3db70bb72
commit 69cfc5566a
3 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,13 @@
def execute():
"""
* Change type of mail_port field to int
* reload email settings
"""
import webnotes
webnotes.conn.sql("""
UPDATE `tabDocField` SET fieldtype='Int'
WHERE parent = 'Email Settings' AND fieldname = 'mail_port'
""")
from webnotes.modules.module_manager import reload_doc
reload_doc('setup', 'doctype', 'email_settings')

View File

@ -45,4 +45,9 @@ patch_list = [
'patch_file': 'doclabel_in_doclayer',
'description': "Show DocType Labels instead of DocType names in Customize Form View"
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'email_settings_reload',
'description': "Change type of mail_port field to Int and reload email_settings doctype"
},
]

View File

@ -71,7 +71,7 @@ class DocType:
"""
Checks support ticket email settings
"""
if self.doc.support_host:
if self.doc.sync_support_mails and self.doc.support_host:
from webnotes.utils.email_lib.receive import POP3Mailbox
from webnotes.model.doc import Document
import _socket, poplib