conf migration
This commit is contained in:
parent
7782e83d33
commit
cfed8c44b4
@ -113,7 +113,7 @@ def backup_to_gdrive():
|
|||||||
|
|
||||||
def get_gdrive_flow():
|
def get_gdrive_flow():
|
||||||
from oauth2client.client import OAuth2WebServerFlow
|
from oauth2client.client import OAuth2WebServerFlow
|
||||||
import conf
|
from webnotes import conf
|
||||||
|
|
||||||
if not hasattr(conf, "gdrive_client_id"):
|
if not hasattr(conf, "gdrive_client_id"):
|
||||||
webnotes.msgprint(_("Please set Google Drive access keys in") + " conf.py",
|
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']
|
return database['id']
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
backup_to_gdrive()
|
backup_to_gdrive()
|
||||||
|
@ -457,7 +457,7 @@ def send():
|
|||||||
from webnotes.utils import getdate
|
from webnotes.utils import getdate
|
||||||
now_date = now_datetime().date()
|
now_date = now_datetime().date()
|
||||||
|
|
||||||
import conf
|
from webnotes import conf
|
||||||
if hasattr(conf, "expires_on") and now_date > getdate(conf.expires_on):
|
if hasattr(conf, "expires_on") and now_date > getdate(conf.expires_on):
|
||||||
# do not send email digests to expired accounts
|
# do not send email digests to expired accounts
|
||||||
return
|
return
|
||||||
|
@ -32,7 +32,7 @@ def boot_session(bootinfo):
|
|||||||
|
|
||||||
|
|
||||||
# load subscription info
|
# load subscription info
|
||||||
import conf
|
from webnotes import conf
|
||||||
for key in ['max_users', 'expires_on', 'max_space', 'status', 'commercial_support']:
|
for key in ['max_users', 'expires_on', 'max_space', 'status', 'commercial_support']:
|
||||||
if hasattr(conf, key): bootinfo[key] = getattr(conf, key)
|
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`
|
ret = webnotes.conn.sql("""select name, content from `tabLetter Head`
|
||||||
where ifnull(disabled,0)=0""")
|
where ifnull(disabled,0)=0""")
|
||||||
return dict(ret)
|
return dict(ret)
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ def on_logout(login_manager):
|
|||||||
|
|
||||||
def check_if_expired():
|
def check_if_expired():
|
||||||
"""check if account is expired. If expired, do not allow login"""
|
"""check if account is expired. If expired, do not allow login"""
|
||||||
import conf
|
from webnotes import conf
|
||||||
# check if expires_on is specified
|
# check if expires_on is specified
|
||||||
if not hasattr(conf, 'expires_on'): return
|
if not hasattr(conf, 'expires_on'): return
|
||||||
|
|
||||||
@ -75,4 +75,4 @@ def comment_added(doc):
|
|||||||
"""add comment to feed"""
|
"""add comment to feed"""
|
||||||
home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
|
home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
|
||||||
'<i>"' + doc.comment + '"</i>', '#6B24B3')
|
'<i>"' + doc.comment + '"</i>', '#6B24B3')
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ class DocType():
|
|||||||
webnotes.msgprint(_("""Please save the Newsletter before sending."""),
|
webnotes.msgprint(_("""Please save the Newsletter before sending."""),
|
||||||
raise_exception=1)
|
raise_exception=1)
|
||||||
|
|
||||||
import conf
|
from webnotes import conf
|
||||||
if getattr(conf, "status", None) == "Trial":
|
if getattr(conf, "status", None) == "Trial":
|
||||||
webnotes.msgprint(_("""Sending newsletters is not allowed for Trial users, \
|
webnotes.msgprint(_("""Sending newsletters is not allowed for Trial users, \
|
||||||
to prevent abuse of this feature."""), raise_exception=1)
|
to prevent abuse of this feature."""), raise_exception=1)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
def on_login(self):
|
def on_login(self):
|
||||||
from webnotes.utils import validate_email_add
|
from webnotes.utils import validate_email_add
|
||||||
import conf
|
from webnotes import conf
|
||||||
if hasattr(conf, "demo_notify_url"):
|
if hasattr(conf, "demo_notify_url"):
|
||||||
if webnotes.form_dict.lead_email and validate_email_add(webnotes.form_dict.lead_email):
|
if webnotes.form_dict.lead_email and validate_email_add(webnotes.form_dict.lead_email):
|
||||||
import requests
|
import requests
|
||||||
@ -10,4 +10,4 @@
|
|||||||
"subject":"Logged into Demo",
|
"subject":"Logged into Demo",
|
||||||
"sender": webnotes.form_dict.lead_email,
|
"sender": webnotes.form_dict.lead_email,
|
||||||
"message": "via demo.erpnext.com"
|
"message": "via demo.erpnext.com"
|
||||||
})
|
})
|
||||||
|
@ -355,7 +355,7 @@ def how_many(doctype):
|
|||||||
def install():
|
def install():
|
||||||
print "Creating Fresh Database..."
|
print "Creating Fresh Database..."
|
||||||
from webnotes.install_lib.install import Installer
|
from webnotes.install_lib.install import Installer
|
||||||
import conf
|
from webnotes import conf
|
||||||
inst = Installer('root')
|
inst = Installer('root')
|
||||||
inst.import_from_db(conf.demo_db_name, verbose = 1)
|
inst.import_from_db(conf.demo_db_name, verbose = 1)
|
||||||
|
|
||||||
@ -414,4 +414,4 @@ def import_data(dt, submit=False, overwrite=False):
|
|||||||
if submit:
|
if submit:
|
||||||
webnotes.form_dict["params"] = json.dumps({"_submit": 1})
|
webnotes.form_dict["params"] = json.dumps({"_submit": 1})
|
||||||
webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", doctype+".csv")
|
webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", doctype+".csv")
|
||||||
upload(overwrite=overwrite)
|
upload(overwrite=overwrite)
|
||||||
|
@ -42,7 +42,7 @@ def make_demo_user():
|
|||||||
p.doc.last_name = "User"
|
p.doc.last_name = "User"
|
||||||
p.doc.enabled = 1
|
p.doc.enabled = 1
|
||||||
p.doc.user_type = "ERPNext Demo"
|
p.doc.user_type = "ERPNext Demo"
|
||||||
p.doc.send_invite_email = 0
|
# p.doc.send_invite_email = 0
|
||||||
p.doc.new_password = "demo"
|
p.doc.new_password = "demo"
|
||||||
p.insert()
|
p.insert()
|
||||||
add_roles(p)
|
add_roles(p)
|
||||||
@ -118,4 +118,4 @@ def make_demo_on_login_script():
|
|||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
make_demo_app()
|
make_demo_app()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user