You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

15 regels
468 B

  1. from __future__ import unicode_literals
  2. def get_home_page(user=None):
  3. """get home page for user"""
  4. if not user:
  5. user = 'Guest'
  6. import webnotes
  7. hpl = webnotes.conn.sql("""select home_page
  8. from `tabDefault Home Page`
  9. where parent='Control Panel'
  10. and role in ('%s') order by idx asc limit 1""" % "', '".join(webnotes.get_roles(user)))
  11. if hpl:
  12. return hpl[0][0]
  13. else:
  14. return webnotes.conn.get_value('Control Panel',None,'home_page') or 'Login Page'