added patch for subdomain

This commit is contained in:
Rushabh Mehta 2012-01-18 10:55:39 +05:30
commit 94b88b9e22
2 changed files with 19 additions and 2 deletions

View 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)

View File

@ -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