mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 11:09:17 +00:00
[minor] fixes for import conf
This commit is contained in:
@@ -34,7 +34,7 @@ def boot_session(bootinfo):
|
||||
# load subscription info
|
||||
from webnotes import conf
|
||||
for key in ['max_users', 'expires_on', 'max_space', 'status', 'commercial_support']:
|
||||
if hasattr(conf, key): bootinfo[key] = getattr(conf, key)
|
||||
if key in conf: bootinfo[key] = conf.get(key)
|
||||
|
||||
bootinfo['docs'] += webnotes.conn.sql("""select name, default_currency, cost_center
|
||||
from `tabCompany`""", as_dict=1, update={"doctype":":Company"})
|
||||
|
||||
@@ -35,13 +35,13 @@ def on_login_post_session(login_manager):
|
||||
set_cart_count()
|
||||
|
||||
def on_logout(login_manager):
|
||||
webnotes.add_cookies["cart_count"] = ""
|
||||
webnotes._response.set_cookie("cart_count", "")
|
||||
|
||||
def check_if_expired():
|
||||
"""check if account is expired. If expired, do not allow login"""
|
||||
from webnotes import conf
|
||||
# check if expires_on is specified
|
||||
if not hasattr(conf, 'expires_on'): return
|
||||
if not 'expires_on' in conf: return
|
||||
|
||||
# check if expired
|
||||
from datetime import datetime, date
|
||||
|
||||
Reference in New Issue
Block a user