2019-05-08 10:56:49 +02:00
|
|
|
# authentic2 - versatile identity manager
|
|
|
|
# Copyright (C) 2010-2019 Entr'ouvert
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU Affero General Public License as published
|
|
|
|
# by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2014-07-18 20:31:53 +02:00
|
|
|
import sys
|
|
|
|
|
2015-05-13 15:20:06 +02:00
|
|
|
|
2014-07-18 20:31:53 +02:00
|
|
|
class AppSettings(object):
|
|
|
|
__PREFIX = 'A2_MANAGER_'
|
|
|
|
__DEFAULTS = {
|
2015-06-04 11:27:46 +02:00
|
|
|
'HOMEPAGE_URL': None,
|
2015-09-11 23:33:40 +02:00
|
|
|
'ROLE_FORM_CLASS': None,
|
2017-10-25 14:52:11 +02:00
|
|
|
'SHOW_ALL_OU': True,
|
2017-03-10 15:02:23 +01:00
|
|
|
'ROLE_MEMBERS_FROM_OU': False,
|
2017-06-21 10:31:29 +02:00
|
|
|
'SHOW_INTERNAL_ROLES': False,
|
2017-07-11 09:31:58 +02:00
|
|
|
'USER_SEARCH_MINIMUM_CHARS': 0,
|
2017-10-13 14:56:13 +02:00
|
|
|
'LOGIN_URL': None,
|
2017-11-23 16:48:08 +01:00
|
|
|
'SITE_TITLE': None,
|
2020-10-05 16:13:00 +02:00
|
|
|
'CHECK_DUPLICATE_USERS': False,
|
2014-07-18 20:31:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
def __getattr__(self, name):
|
|
|
|
from django.conf import settings
|
|
|
|
if name not in self.__DEFAULTS:
|
|
|
|
raise AttributeError
|
|
|
|
return getattr(settings, self.__PREFIX + name, self.__DEFAULTS[name])
|
|
|
|
|
|
|
|
app_settings = AppSettings()
|
|
|
|
app_settings.__name__ = __name__
|
|
|
|
sys.modules[__name__] = app_settings
|