@@ -79,18 +79,16 @@ def edit(self, instance):
7979 application_access_token .language = instance .get ('language' )
8080 if 'language' not in instance or instance .get ('language' ) is None :
8181 application_access_token .language = None
82+
8283 application_access_token .save ()
83- application_setting_model = DatabaseModelManage .get_model ('application_setting' )
8484 license_is_valid = cache .get (Cache_Version .SYSTEM .get_key (key = 'license_is_valid' ),
8585 version = Cache_Version .SYSTEM .get_version ())
86- if application_setting_model is not None and license_is_valid :
87- application_setting , _ = application_setting_model .objects .get_or_create (
88- application_id = self .data .get ('application_id' ))
89- if application_setting is not None and instance .get ('authentication' ) is not None and instance .get (
86+ if license_is_valid :
87+ if instance .get ('authentication' ) is not None and instance .get (
9088 'authentication_value' ) is not None :
91- application_setting .authentication = instance .get ('authentication' )
92- application_setting .authentication_value = instance .get ('authentication_value' )
93- application_setting .save ()
89+ application_access_token .authentication = instance .get ('authentication' )
90+ application_access_token .authentication_value = instance .get ('authentication_value' )
91+ application_access_token .save ()
9492 return self .one (with_valid = False )
9593
9694 def one (self , with_valid = True ):
@@ -105,14 +103,12 @@ def one(self, with_valid=True):
105103 str (uuid .uuid7 ()).encode ()).hexdigest ()[
106104 8 :24 ], is_active = True )
107105 application_access_token .save ()
108- application_setting_model = DatabaseModelManage .get_model ('application_setting' )
109106 other = {}
110- if application_setting_model is not None :
111- application_setting , _ = application_setting_model .objects .get_or_create (
112- application_id = self .data .get ('application_id' ))
113- if application_setting is not None :
114- other = {'authentication' : application_setting .authentication ,
115- 'authentication_value' : application_setting .authentication_value }
107+ license_is_valid = cache .get (Cache_Version .SYSTEM .get_key (key = 'license_is_valid' ),
108+ version = Cache_Version .SYSTEM .get_version ())
109+ if license_is_valid :
110+ other = {'authentication' : application_access_token .authentication ,
111+ 'authentication_value' : application_access_token .authentication_value }
116112
117113 return {'application_id' : application_access_token .application_id ,
118114 'access_token' : application_access_token .access_token ,
0 commit comments