File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,31 @@ items is enabled or not.
2727
2828Refer to :ref: `organization_owners ` for more information.
2929
30+ ``OPENWISP_USERS_SOCIALACCOUNT_ADMIN_NEEDED ``
31+ ---------------------------------------------
32+
33+ ============ =========================================
34+ **type **: ``boolean ``
35+ **default **: auto-detected based on ``INSTALLED_APPS ``
36+ ============ =========================================
37+
38+ Controls whether the social account admin (used to manage OAuth/SAML
39+ application credentials such as client IDs and secrets) is shown in the
40+ Django admin.
41+
42+ By default, this is set to ``True `` automatically when any app whose name
43+ starts with ``allauth.socialaccount.providers. `` is found in
44+ ``INSTALLED_APPS ``.
45+
46+ Set this to ``True `` explicitly when using custom or third-party allauth
47+ provider apps that do not follow the ``allauth.socialaccount.providers.* ``
48+ namespace convention, so that their ``SocialApp `` credentials can be
49+ managed in the Django admin.
50+
51+ .. code-block :: python
52+
53+ OPENWISP_USERS_SOCIALACCOUNT_ADMIN_NEEDED = True
54+
3055 .. _openwisp_users_auth_api :
3156
3257``OPENWISP_USERS_AUTH_API ``
Original file line number Diff line number Diff line change 5050 ),
5151)
5252
53- # if OAuth/SAML is enabled, allow manging keys/secrets
54- if any (
55- app .startswith ("allauth.socialaccount.providers" ) for app in settings .INSTALLED_APPS
56- ): # pragma: no cover
57- SOCIALACCOUNT_ADMIN_NEEDED = True
58- # otherwise hide the socialaccount admin (not needed)
59- else :
60- SOCIALACCOUNT_ADMIN_NEEDED = False
53+ # if any OAuth/SAML provider is enabled, allow managing keys/secrets
54+ SOCIALACCOUNT_ADMIN_NEEDED = getattr (
55+ settings ,
56+ "OPENWISP_USERS_SOCIALACCOUNT_ADMIN_NEEDED" ,
57+ any (
58+ app .startswith ("allauth.socialaccount.providers." )
59+ for app in settings .INSTALLED_APPS
60+ ),
61+ )
You can’t perform that action at this time.
0 commit comments