MCPcopy
hub / github.com/1Panel-dev/MaxKB / get_auth_setting

Method get_auth_setting

apps/users/serializers/login.py:84–95  ·  view source on GitHub ↗

获取认证设置

()

Source from the content-addressed store, hash-verified

82class LoginSerializer(serializers.Serializer):
83 @staticmethod
84 def get_auth_setting():
85 """获取认证设置"""
86 auth_setting_model = DatabaseModelManage.get_model("auth_setting")
87 auth_setting = {}
88 if auth_setting_model:
89 setting_obj = auth_setting_model.objects.filter(param_key="auth_setting").first()
90 if setting_obj:
91 try:
92 auth_setting = json.loads(setting_obj.param_value) or {}
93 except Exception:
94 auth_setting = {}
95 return auth_setting
96
97 @staticmethod
98 def login(instance):

Callers 2

loginMethod · 0.80
generateMethod · 0.80

Calls 1

get_modelMethod · 0.45

Tested by

no test coverage detected