Fix in control panel settings not to be available in js
This commit is contained in:
parent
f98cca8a4f
commit
2e1ccff105
2 changed files with 32 additions and 5 deletions
|
|
@ -87,12 +87,35 @@ def create_folder(path):
|
|||
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except Exception, e:
|
||||
if e.args[0]==17:
|
||||
pass
|
||||
else:
|
||||
except OSError, e:
|
||||
if e.args[0]!=17:
|
||||
raise e
|
||||
|
||||
def create_symlink(source_path, link_path):
|
||||
"""
|
||||
Wrapper function for os.symlink (does not throw exception if directory exists)
|
||||
"""
|
||||
import os
|
||||
|
||||
try:
|
||||
os.symlink(source_path, link_path)
|
||||
except OSError, e:
|
||||
if e.args[0]!=17:
|
||||
raise e
|
||||
|
||||
def remove_file(path):
|
||||
"""
|
||||
Wrapper function for os.remove (does not throw exception if file/symlink does not exists)
|
||||
"""
|
||||
import os
|
||||
|
||||
try:
|
||||
os.remove(path)
|
||||
except OSError, e:
|
||||
if e.args[0]!=2:
|
||||
raise e
|
||||
|
||||
|
||||
def connect(db_name=None):
|
||||
"""
|
||||
Connect to this db (or db), if called from command prompt
|
||||
|
|
@ -128,4 +151,4 @@ def get_db_password(db_name):
|
|||
return defs.db_password
|
||||
|
||||
else:
|
||||
return db_name
|
||||
return db_name
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ def get_bootinfo():
|
|||
# control panel
|
||||
import webnotes.model.doc
|
||||
cp = webnotes.model.doc.getsingle('Control Panel')
|
||||
|
||||
# remove email settings from control panel dict
|
||||
for field in ['mail_login', 'mail_password', 'mail_port', 'outgoing_mail_server', 'use_ssl']:
|
||||
del cp[field]
|
||||
|
||||
# system info
|
||||
bootinfo['control_panel'] = cp
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue