@@ -96,18 +96,13 @@ def update_app_name_by_id(self, magic_client_id, app_name):
9696 self .session_factory (), magic_client_id , app_name = app_name
9797 )
9898
99- if not client :
100- return None
101-
102- return client .app_name
99+ return client .app_name if client else None
103100
104101 def update_by_id (self , magic_client_id , ** kwargs ):
105- client = self .logic .MagicClient .update_by_id (
102+ return self .logic .MagicClient .update_by_id (
106103 self .session_factory (), magic_client_id , ** kwargs
107104 )
108105
109- return client
110-
111106 def set_inactive_by_id (self , magic_client_id ):
112107 """
113108 Args:
@@ -309,16 +304,14 @@ def search_by_client_id_and_substring(
309304 if not isinstance (substring , str ) or len (substring ) < 3 :
310305 raise InvalidSubstringError ()
311306
312- auth_users = self .logic .AuthUser .get_by_client_id_with_substring_search (
307+ return self .logic .AuthUser .get_by_client_id_with_substring_search (
313308 self .session_factory (),
314309 client_id ,
315310 substring ,
316311 offset = offset ,
317312 limit = limit ,
318313 )
319314
320- return auth_users
321-
322315 def is_magic_connect_enabled (self , auth_user_id = None , auth_user = None ):
323316 if auth_user is None and auth_user_id is None :
324317 raise Exception ("At least one argument needed: auth_user_id or auth_user." )
@@ -397,11 +390,10 @@ def sync_auth_wallet(
397390 ):
398391 session = self .session_factory ()
399392 with session .begin_nested ():
400- existing_wallet = self .logic .AuthWallet .get_by_auth_user_id (
393+ if existing_wallet : = self .logic .AuthWallet .get_by_auth_user_id (
401394 session ,
402395 auth_user_id ,
403- )
404- if existing_wallet :
396+ ):
405397 raise RuntimeError ("WalletExistsForNetworkAndWalletType" )
406398
407399 return self .logic .AuthWallet .add (
0 commit comments