@@ -130,11 +130,11 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
130130 ]
131131 models = models + arena_models
132132
133- global_action_ids = [ function .id for function in Functions .get_global_action_functions ()]
134- enabled_action_ids = [ function .id for function in Functions .get_functions_by_type ('action' , active_only = True )]
133+ global_action_ids = { function .id for function in Functions .get_global_action_functions ()}
134+ enabled_action_ids = { function .id for function in Functions .get_functions_by_type ('action' , active_only = True )}
135135
136- global_filter_ids = [ function .id for function in Functions .get_global_filter_functions ()]
137- enabled_filter_ids = [ function .id for function in Functions .get_functions_by_type ('filter' , active_only = True )]
136+ global_filter_ids = { function .id for function in Functions .get_global_filter_functions ()}
137+ enabled_filter_ids = { function .id for function in Functions .get_functions_by_type ('filter' , active_only = True )}
138138
139139 custom_models = Models .get_all_models ()
140140
@@ -328,14 +328,14 @@ def get_action_priority(action_id):
328328 for model in models :
329329 action_ids = [
330330 action_id
331- for action_id in list ( set (model .pop ('action_ids' , []) + global_action_ids ))
331+ for action_id in set (model .pop ('action_ids' , [])) | global_action_ids
332332 if action_id in enabled_action_ids
333333 ]
334334 action_ids .sort (key = lambda aid : (get_action_priority (aid ), aid ))
335335
336336 filter_ids = [
337337 filter_id
338- for filter_id in list ( set (model .pop ('filter_ids' , []) + global_filter_ids ))
338+ for filter_id in set (model .pop ('filter_ids' , [])) | global_filter_ids
339339 if filter_id in enabled_filter_ids
340340 ]
341341
0 commit comments