diff --git a/InvenTree/InvenTree/forms.py b/InvenTree/InvenTree/forms.py
index 02b993d31b..91863f04e2 100644
--- a/InvenTree/InvenTree/forms.py
+++ b/InvenTree/InvenTree/forms.py
@@ -150,13 +150,13 @@ class DeleteForm(forms.Form):
class EditUserForm(HelperForm):
- """ Form for editing user information
+ """
+ Form for editing user information
"""
class Meta:
model = User
fields = [
- 'username',
'first_name',
'last_name',
]
diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py
index 8b43e2191c..33168fad2d 100644
--- a/InvenTree/InvenTree/settings.py
+++ b/InvenTree/InvenTree/settings.py
@@ -62,12 +62,6 @@ DEBUG = _is_true(get_setting(
CONFIG.get('debug', True)
))
-# Determine if we are running in "demo mode"
-DEMO_MODE = _is_true(get_setting(
- 'INVENTREE_DEMO',
- CONFIG.get('demo', False)
-))
-
DOCKER = _is_true(get_setting(
'INVENTREE_DOCKER',
False
@@ -217,9 +211,6 @@ MEDIA_URL = '/media/'
if DEBUG:
logger.info("InvenTree running with DEBUG enabled")
-if DEMO_MODE:
- logger.warning("InvenTree running in DEMO mode") # pragma: no cover
-
logger.debug(f"MEDIA_ROOT: '{MEDIA_ROOT}'")
logger.debug(f"STATIC_ROOT: '{STATIC_ROOT}'")
@@ -921,7 +912,7 @@ PLUGIN_TESTING_SETUP = get_setting('PLUGIN_TESTING_SETUP', False) # load plugin
PLUGIN_RETRY = get_setting('PLUGIN_RETRY', 5) # how often should plugin loading be tried?
PLUGIN_FILE_CHECKED = False # Was the plugin file checked?
-# user interface customization values
+# User interface customization values
CUSTOMIZE = get_setting(
'INVENTREE_CUSTOMIZE',
CONFIG.get('customize', {}),
diff --git a/InvenTree/InvenTree/views.py b/InvenTree/InvenTree/views.py
index feb586c844..183e491580 100644
--- a/InvenTree/InvenTree/views.py
+++ b/InvenTree/InvenTree/views.py
@@ -34,8 +34,7 @@ from user_sessions.views import SessionDeleteView, SessionDeleteOtherView
from common.settings import currency_code_default, currency_codes
-from part.models import Part, PartCategory
-from stock.models import StockLocation, StockItem
+from part.models import PartCategory
from common.models import InvenTreeSetting, ColorTheme
from users.models import check_user_role, RuleSet
@@ -882,29 +881,6 @@ class DatabaseStatsView(AjaxView):
ajax_template_name = "stats.html"
ajax_form_title = _("System Information")
- def get_context_data(self, **kwargs):
-
- ctx = {}
-
- # Part stats
- ctx['part_count'] = Part.objects.count()
- ctx['part_cat_count'] = PartCategory.objects.count()
-
- # Stock stats
- ctx['stock_item_count'] = StockItem.objects.count()
- ctx['stock_loc_count'] = StockLocation.objects.count()
-
- """
- TODO: Other ideas for database metrics
-
- - "Popular" parts (used to make other parts?)
- - Most ordered part
- - Most sold part
- - etc etc etc
- """
-
- return ctx
-
class NotificationsView(TemplateView):
""" View for showing notifications
diff --git a/InvenTree/config_template.yaml b/InvenTree/config_template.yaml
index a9a1db9ad8..cad7012ebe 100644
--- a/InvenTree/config_template.yaml
+++ b/InvenTree/config_template.yaml
@@ -201,3 +201,5 @@ static_root: '/home/inventree/data/static'
# login_message: InvenTree demo instance - Click here for login details
# navbar_message:
InvenTree demo mode
# logo: logo.png
+# hide_admin_link: true
+# hide_password_reset: true
diff --git a/InvenTree/part/templatetags/inventree_extras.py b/InvenTree/part/templatetags/inventree_extras.py
index 5701658087..889946ff19 100644
--- a/InvenTree/part/templatetags/inventree_extras.py
+++ b/InvenTree/part/templatetags/inventree_extras.py
@@ -160,13 +160,6 @@ def inventree_in_debug_mode(*args, **kwargs):
return djangosettings.DEBUG
-@register.simple_tag()
-def inventree_demo_mode(*args, **kwargs):
- """ Return True if the server is running in DEMO mode """
-
- return djangosettings.DEMO_MODE
-
-
@register.simple_tag()
def inventree_show_about(user, *args, **kwargs):
""" Return True if the about modal should be shown """
diff --git a/InvenTree/templates/InvenTree/settings/user.html b/InvenTree/templates/InvenTree/settings/user.html
index 32bc4d43e7..d3d1e35210 100644
--- a/InvenTree/templates/InvenTree/settings/user.html
+++ b/InvenTree/templates/InvenTree/settings/user.html
@@ -13,15 +13,15 @@
{% endblock %}
{% block actions %}
-{% inventree_demo_mode as demo %}
-{% if not demo %}
+{% inventree_customize 'hide_password_reset' as hide_password_reset %}
+{% if not hide_password_reset %}
{% trans "Set Password" %}
+{% endif %}
{% trans "Edit" %}
-{% endif %}
{% endblock %}
{% block content %}
diff --git a/InvenTree/templates/account/login.html b/InvenTree/templates/account/login.html
index fcdd08a23c..042c119440 100644
--- a/InvenTree/templates/account/login.html
+++ b/InvenTree/templates/account/login.html
@@ -12,7 +12,6 @@
{% settings_value 'LOGIN_ENABLE_SSO' as enable_sso %}
{% inventree_customize 'login_message' as login_message %}
{% mail_configured as mail_conf %}
-{% inventree_demo_mode as demo %}
{% trans "Sign In" %}
@@ -37,12 +36,12 @@ for a account and sign in below:{% endblocktrans %}
{% if login_message %}
- {{ login_message }}
+ {{ login_message | safe }}
{% endif %}
- {% if mail_conf and enable_pwd_forgot and not demo %}
+ {% if mail_conf and enable_pwd_forgot %}
{% trans "Forgot Password?" %}
{% endif %}
diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html
index 0188ecefa5..8c2a949353 100644
--- a/InvenTree/templates/base.html
+++ b/InvenTree/templates/base.html
@@ -8,7 +8,6 @@
{% settings_value "SERVER_RESTART_REQUIRED" as server_restart_required %}
{% settings_value "LABEL_ENABLE" with user=user as labels_enabled %}
{% inventree_show_about user as show_about %}
-{% inventree_demo_mode as demo_mode %}
@@ -94,7 +93,7 @@
{% block alerts %}
- {% if server_restart_required and not demo_mode %}
+ {% if server_restart_required %}
{% trans "Server Restart Required" %}
diff --git a/InvenTree/templates/navbar.html b/InvenTree/templates/navbar.html
index d7d70db59f..4660123e0d 100644
--- a/InvenTree/templates/navbar.html
+++ b/InvenTree/templates/navbar.html
@@ -6,9 +6,10 @@
{% settings_value 'BARCODE_ENABLE' as barcodes %}
{% settings_value 'STICKY_HEADER' user=request.user as sticky %}
{% navigation_enabled as plugin_nav %}
-{% inventree_demo_mode as demo %}
+
{% inventree_show_about user as show_about %}
{% inventree_customize 'navbar_message' as navbar_message %}
+{% inventree_customize 'hide_admin_link' as hide_admin_link %}