added get_site_address method to website's init

This commit is contained in:
Anand Doshi
2012-10-16 10:47:18 +05:30
parent aea8204997
commit 7aedaec6b6
3 changed files with 24 additions and 14 deletions

View File

@@ -23,4 +23,16 @@ def send_message():
webnotes.msgprint('Please give us your email id so that we can write back to you', raise_exception=True)
d.save()
webnotes.msgprint('Thank you!')
webnotes.msgprint('Thank you!')
def get_site_address():
from webnotes.utils import get_request_site_address
url = get_request_site_address()
if not url or url=='http://localhost':
new_url = webnotes.conn.get_value('Website Settings', 'Website Settings',
'subdomain')
if new_url:
url = "http://" + new_url
return url