[website] [minor] moving to framework

This commit is contained in:
Anand Doshi
2013-09-10 18:29:39 +05:30
parent f2d0255031
commit b0d996ffb1
52 changed files with 606 additions and 199 deletions

View File

@@ -1,34 +1,10 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
import webnotes, conf, os
from webnotes.utils import cint, cstr, encode
import webnotes
from webnotes.utils import cint
def get_website_settings():
return {
"shopping_cart_enabled": cint(webnotes.conn.get_default("shopping_cart_enabled"))
}
@webnotes.whitelist()
def update_profile(fullname, password=None, company_name=None, mobile_no=None, phone=None):
from selling.utils.cart import update_party
update_party(fullname, company_name, mobile_no, phone)
from core.doctype.profile import profile
return profile.update_profile(fullname, password)
def get_profile_args():
from selling.utils.cart import get_lead_or_customer
party = get_lead_or_customer()
if party.doctype == "Lead":
mobile_no = party.mobile_no
phone = party.phone
else:
mobile_no, phone = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user,
"customer": party.name}, ["mobile_no", "phone"])
return {
"company_name": cstr(party.customer_name if party.doctype == "Customer" else party.company_name),
"mobile_no": cstr(mobile_no),
"phone": cstr(phone)
}