diff --git a/community/hooks.py b/community/hooks.py index 1332aebd..ea17ba2f 100644 --- a/community/hooks.py +++ b/community/hooks.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals from . import __version__ as app_version +import os app_name = "community" app_title = "Community" @@ -10,6 +11,9 @@ app_icon = "octicon octicon-file-directory" app_color = "grey" app_email = "jannat@erpnext.com" app_license = "AGPL" + +app_logo_url = os.getenv("APP_LOGO_URL") or "/files/logo.png" + # Includes in # ------------------ @@ -59,7 +63,7 @@ web_include_css = "/assets/css/community.css" # ------------ # before_install = "community.install.before_install" -# after_install = "community.install.after_install" +after_install = "community.install.after_install" # Desk Notifications # ------------------ diff --git a/community/install.py b/community/install.py new file mode 100644 index 00000000..ad627c67 --- /dev/null +++ b/community/install.py @@ -0,0 +1,16 @@ +"""Hooks that are executed during and after install. +""" +import os +import frappe + +def after_install(): + set_app_name() + disable_signup() + +def set_app_name(): + app_name = os.getenv("FRAPPE_APP_NAME") + if app_name: + frappe.db.set_value('System Settings', None, 'app_name', app_name) + +def disable_signup(): + frappe.db.set_value("Website Settings", None, "disable_signup", 1)