File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,14 @@ def profile(self):
6464 'authentication' : False
6565 }
6666 application_setting_model = DatabaseModelManage .get_model ('application_setting' )
67- if application_setting_model :
67+ chat_platform = DatabaseModelManage .get_model ('chat_platform' )
68+ if application_setting_model and chat_platform :
6869 application_setting = QuerySet (application_setting_model ).filter (application_id = application_id ).first ()
70+ types = QuerySet (chat_platform ).filter (is_active = True , is_valid = True ).values_list ('auth_type' , flat = True )
71+ login_value = application_access_token .authentication_value .get ('login_value' , [])
72+ final_login_value = list (set (login_value ) & set (types ))
73+ if 'LOCAL' in login_value :
74+ final_login_value .insert (0 , 'LOCAL' )
6975 if application_setting is not None :
7076 profile = {
7177 'icon' : application_setting .application .icon ,
@@ -74,7 +80,7 @@ def profile(self):
7480 'authentication' : application_access_token .authentication ,
7581 'authentication_type' : application_access_token .authentication_value .get (
7682 'type' , 'password' ),
77- 'login_value' : application_access_token . authentication_value . get ( 'login_value' , [])
83+ 'login_value' : final_login_value
7884 }
7985 return profile
8086
Original file line number Diff line number Diff line change @@ -211,7 +211,6 @@ class Query(serializers.Serializer):
211211 is_active = serializers .BooleanField (
212212 required = False ,
213213 label = _ ("Is active" ),
214- default = True
215214 )
216215 source = serializers .CharField (
217216 required = False ,
@@ -223,7 +222,7 @@ def get_query_set(self):
223222 username = self .data .get ('username' )
224223 nick_name = self .data .get ('nick_name' )
225224 email = self .data .get ('email' )
226- is_active = self .data .get ('is_active' , True )
225+ is_active = self .data .get ('is_active' , None )
227226 source = self .data .get ('source' , None )
228227 query_set = QuerySet (User )
229228 if username is not None :
You can’t perform that action at this time.
0 commit comments