added patch for subdomain
This commit is contained in:
commit
94b88b9e22
16
erpnext/patches/jan_mar_2012/subdomain_login_patch.py
Normal file
16
erpnext/patches/jan_mar_2012/subdomain_login_patch.py
Normal file
@ -0,0 +1,16 @@
|
||||
import webnotes
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
from webnotes.model.doc import Document
|
||||
|
||||
def execute():
|
||||
add_default_home_page()
|
||||
|
||||
def add_default_home_page():
|
||||
d = Document('Default Home Page')
|
||||
d.parent = 'Control Panel'
|
||||
d.parenttype = 'Control Panel'
|
||||
d.parentfield = 'default_home_pages'
|
||||
d.role = 'Guest'
|
||||
d.home_page = 'Login Page'
|
||||
d.save(1)
|
@ -7,8 +7,9 @@ def on_login(login_manager):
|
||||
called from login manager, before login
|
||||
"""
|
||||
try:
|
||||
import server_tools.gateway_utils
|
||||
server_tools.gateway_utils.check_login(login_manager.user)
|
||||
if login_manager.user not in ('Guest', None, ''):
|
||||
import server_tools.gateway_utils
|
||||
server_tools.gateway_utils.check_login(login_manager.user)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user