File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -314,10 +314,13 @@ def is_valid_chat_user(self):
314314 application_id = self .data .get ('application_id' )
315315 chat_user_type = self .data .get ('chat_user_type' )
316316 is_auth_chat_user = DatabaseModelManage .get_model ("is_auth_chat_user" )
317- if chat_user_type == ChatUserType .CHAT_USER .value and is_auth_chat_user :
318- is_auth = is_auth_chat_user (chat_user_id , application_id )
319- if not is_auth :
320- raise ChatException (500 , _ ("The chat user is not authorized." ))
317+ application_access_token = QuerySet (ApplicationAccessToken ).filter (application_id = application_id ).first ()
318+ if application_access_token and application_access_token .authentication and application_access_token .authentication_value .get (
319+ 'type' ) == 'login' :
320+ if chat_user_type == ChatUserType .CHAT_USER .value and is_auth_chat_user :
321+ is_auth = is_auth_chat_user (chat_user_id , application_id )
322+ if not is_auth :
323+ raise ChatException (500 , _ ("The chat user is not authorized." ))
321324
322325 def chat (self , instance : dict , base_to_response : BaseToResponse = SystemToResponse ()):
323326 super ().is_valid (raise_exception = True )
You can’t perform that action at this time.
0 commit comments