|
128 | 128 |
|
129 | 129 | RESTRICTED_DOMAINS_FOR_USER_REGISTRATION = ["xxx.com", "emaildomainwhatever.com"] |
130 | 130 |
|
| 131 | +# by default users do not need to be approved. If this is set to True, then new users |
| 132 | +# will have to be approved before they can login successfully |
| 133 | +USERS_NEEDS_TO_BE_APPROVED = False |
| 134 | + |
131 | 135 | # Comma separated list of domains: ["organization.com", "private.organization.com", "org2.com"] |
132 | 136 | # Empty list disables. |
133 | 137 | ALLOWED_DOMAINS_FOR_USER_REGISTRATION = [] |
|
501 | 505 | # Whether to allow anonymous users to list all users |
502 | 506 | ALLOW_ANONYMOUS_USER_LISTING = True |
503 | 507 |
|
| 508 | +# Who can see the members page |
| 509 | +# valid choices are all, editors, admins |
| 510 | +CAN_SEE_MEMBERS_PAGE = "all" |
| 511 | + |
504 | 512 | # Maximum number of media a user can upload |
505 | 513 | NUMBER_OF_MEDIA_USER_CAN_UPLOAD = 100 |
506 | 514 |
|
|
517 | 525 | # Whisper transcribe options - https://github.com/openai/whisper |
518 | 526 | WHISPER_MODEL = "base" |
519 | 527 |
|
| 528 | +# show a custom text in the sidebar footer, otherwise the default will be shown if this is empty |
| 529 | +SIDEBAR_FOOTER_TEXT = "" |
| 530 | + |
520 | 531 | try: |
521 | 532 | # keep a local_settings.py file for local overrides |
522 | 533 | from .local_settings import * # noqa |
|
558 | 569 | if GLOBAL_LOGIN_REQUIRED: |
559 | 570 | auth_index = MIDDLEWARE.index("django.contrib.auth.middleware.AuthenticationMiddleware") |
560 | 571 | MIDDLEWARE.insert(auth_index + 1, "django.contrib.auth.middleware.LoginRequiredMiddleware") |
| 572 | + |
| 573 | + |
| 574 | +if USERS_NEEDS_TO_BE_APPROVED: |
| 575 | + AUTHENTICATION_BACKENDS = ( |
| 576 | + 'cms.auth_backends.ApprovalBackend', |
| 577 | + 'allauth.account.auth_backends.AuthenticationBackend', |
| 578 | + ) |
| 579 | + auth_index = MIDDLEWARE.index("django.contrib.auth.middleware.AuthenticationMiddleware") |
| 580 | + MIDDLEWARE.insert(auth_index + 1, "cms.middleware.ApprovalMiddleware") |
0 commit comments