From 0a8401da1d034b13789cb86455ebe231b31c9e19 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 7 Sep 2021 23:07:23 +0200 Subject: [PATCH] some settings in config --- InvenTree/InvenTree/settings.py | 4 ++++ InvenTree/config_template.yaml | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index 20f1bfbf19..28893c926f 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -662,6 +662,10 @@ for app in SOCIAL_BACKENDS: INSTALLED_APPS.append(app) # settings for allauth +ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = get_setting('INVENTREE_LOGIN_CONFIRM_DAYS', CONFIG.get('login_confirm_days', 3)) + +ACCOUNT_LOGIN_ATTEMPTS_LIMIT = get_setting('INVENTREE_LOGIN_ATTEMPTS', CONFIG.get('login_attempts', 5)) + ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True # override forms / adapters diff --git a/InvenTree/config_template.yaml b/InvenTree/config_template.yaml index 177b1eaf0a..4ee52d54ad 100644 --- a/InvenTree/config_template.yaml +++ b/InvenTree/config_template.yaml @@ -141,6 +141,14 @@ static_root: '/home/inventree/data/static' # - git # - ssh +# Login configuration +# How long do confirmation mail last? +# Use environment variable INVENTREE_LOGIN_CONFIRM_DAYS +#login_confirm_days: 3 +# How many wrong login attempts are permitted? +# Use environment variable INVENTREE_LOGIN_ATTEMPTS +#login_attempts: 5 + # Permit custom authentication backends #authentication_backends: # - 'django.contrib.auth.backends.ModelBackend'