feat: 添加限制用户只能从source登录的功能 (#5592)

* stash it

* feat: 添加限制用户只能从source登录的功能

* fix: 修复小错误

Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
fit2bot
2021-02-26 17:33:11 +08:00
committed by GitHub
parent b483f78d52
commit a7ab7da61c
18 changed files with 146 additions and 319 deletions

View File

@@ -90,7 +90,7 @@ class Setting(models.Model):
setting = cls.objects.filter(name='AUTH_LDAP').first()
if not setting:
return
ldap_backend = 'authentication.backends.ldap.LDAPAuthorizationBackend'
ldap_backend = settings.AUTH_BACKEND_LABEL_MAPPING['ldap']
backends = settings.AUTHENTICATION_BACKENDS
has = ldap_backend in backends
if setting.cleaned_value and not has: