feat: set app name and logo on install and disable signup
- set app_name and app_logo_url on install - disabled signup
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from . import __version__ as app_version
|
from . import __version__ as app_version
|
||||||
|
import os
|
||||||
|
|
||||||
app_name = "community"
|
app_name = "community"
|
||||||
app_title = "Community"
|
app_title = "Community"
|
||||||
@@ -10,6 +11,9 @@ app_icon = "octicon octicon-file-directory"
|
|||||||
app_color = "grey"
|
app_color = "grey"
|
||||||
app_email = "jannat@erpnext.com"
|
app_email = "jannat@erpnext.com"
|
||||||
app_license = "AGPL"
|
app_license = "AGPL"
|
||||||
|
|
||||||
|
app_logo_url = os.getenv("APP_LOGO_URL") or "/files/logo.png"
|
||||||
|
|
||||||
# Includes in <head>
|
# Includes in <head>
|
||||||
# ------------------
|
# ------------------
|
||||||
|
|
||||||
@@ -59,7 +63,7 @@ web_include_css = "/assets/css/community.css"
|
|||||||
# ------------
|
# ------------
|
||||||
|
|
||||||
# before_install = "community.install.before_install"
|
# before_install = "community.install.before_install"
|
||||||
# after_install = "community.install.after_install"
|
after_install = "community.install.after_install"
|
||||||
|
|
||||||
# Desk Notifications
|
# Desk Notifications
|
||||||
# ------------------
|
# ------------------
|
||||||
|
|||||||
16
community/install.py
Normal file
16
community/install.py
Normal file
@@ -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)
|
||||||
Reference in New Issue
Block a user