conf migration

This commit is contained in:
Pratik Vyas 2013-09-21 15:16:47 +05:30
parent 7782e83d33
commit cfed8c44b4
8 changed files with 14 additions and 14 deletions

View File

@ -113,7 +113,7 @@ def backup_to_gdrive():
def get_gdrive_flow():
from oauth2client.client import OAuth2WebServerFlow
import conf
from webnotes import conf
if not hasattr(conf, "gdrive_client_id"):
webnotes.msgprint(_("Please set Google Drive access keys in") + " conf.py",
@ -169,4 +169,4 @@ def create_folder(name, service, folder_id):
return database['id']
if __name__=="__main__":
backup_to_gdrive()
backup_to_gdrive()

View File

@ -457,7 +457,7 @@ def send():
from webnotes.utils import getdate
now_date = now_datetime().date()
import conf
from webnotes import conf
if hasattr(conf, "expires_on") and now_date > getdate(conf.expires_on):
# do not send email digests to expired accounts
return

View File

@ -32,7 +32,7 @@ def boot_session(bootinfo):
# load subscription info
import conf
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)
@ -53,4 +53,4 @@ def get_letter_heads():
ret = webnotes.conn.sql("""select name, content from `tabLetter Head`
where ifnull(disabled,0)=0""")
return dict(ret)

View File

@ -39,7 +39,7 @@ def on_logout(login_manager):
def check_if_expired():
"""check if account is expired. If expired, do not allow login"""
import conf
from webnotes import conf
# check if expires_on is specified
if not hasattr(conf, 'expires_on'): return
@ -75,4 +75,4 @@ def comment_added(doc):
"""add comment to feed"""
home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
'<i>"' + doc.comment + '"</i>', '#6B24B3')

View File

@ -90,7 +90,7 @@ class DocType():
webnotes.msgprint(_("""Please save the Newsletter before sending."""),
raise_exception=1)
import conf
from webnotes import conf
if getattr(conf, "status", None) == "Trial":
webnotes.msgprint(_("""Sending newsletters is not allowed for Trial users, \
to prevent abuse of this feature."""), raise_exception=1)

View File

@ -1,7 +1,7 @@
def on_login(self):
from webnotes.utils import validate_email_add
import conf
from webnotes import conf
if hasattr(conf, "demo_notify_url"):
if webnotes.form_dict.lead_email and validate_email_add(webnotes.form_dict.lead_email):
import requests
@ -10,4 +10,4 @@
"subject":"Logged into Demo",
"sender": webnotes.form_dict.lead_email,
"message": "via demo.erpnext.com"
})
})

View File

@ -355,7 +355,7 @@ def how_many(doctype):
def install():
print "Creating Fresh Database..."
from webnotes.install_lib.install import Installer
import conf
from webnotes import conf
inst = Installer('root')
inst.import_from_db(conf.demo_db_name, verbose = 1)
@ -414,4 +414,4 @@ def import_data(dt, submit=False, overwrite=False):
if submit:
webnotes.form_dict["params"] = json.dumps({"_submit": 1})
webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", doctype+".csv")
upload(overwrite=overwrite)
upload(overwrite=overwrite)

View File

@ -42,7 +42,7 @@ def make_demo_user():
p.doc.last_name = "User"
p.doc.enabled = 1
p.doc.user_type = "ERPNext Demo"
p.doc.send_invite_email = 0
# p.doc.send_invite_email = 0
p.doc.new_password = "demo"
p.insert()
add_roles(p)
@ -118,4 +118,4 @@ def make_demo_on_login_script():
webnotes.conn.commit()
if __name__=="__main__":
make_demo_app()
make_demo_app()