@@ -911,40 +911,30 @@ def get(self, request, format=None, **kwargs):
911
911
912
912
#if model id not specifiedorresponding to this alias.
913
913
if (len (id ) == 0 ):
914
-
915
- # print("after going in first loop :", time.time()-time_spent)
916
- # time_spent=time.time()
914
+
917
915
web_app = request .GET .getlist ('web_app' )
918
916
919
917
920
918
#if the request comes from the webapp : uses collab_parameters
921
919
if len (web_app ) > 0 and web_app [0 ] == 'True' :
922
920
923
- # print("after going in first if :", time.time()-time_spent)
924
- # time_spent=time.time()
921
+
925
922
app_id = request .GET .getlist ('app_id' )[0 ]
926
- # print("after getting app_id:", time.time()-time_spent)
927
- # time_spent=time.time()
923
+
928
924
collab_id = get_collab_id_from_app_id (app_id )
929
- # print("after getting collab_id :", time.time()-time_spent)
930
- # time_spent=time.time()
925
+
931
926
collab_params = CollabParameters .objects .get (id = app_id )
932
927
933
928
collab_ids = list (CollabParameters .objects .all ().values_list ('collab_id' , flat = True ).distinct ())
934
- # print("after getting collab_ids_list :", time.time()-time_spent)
935
- # collab_ids = ["2180"] #######don't forget to erase it!!!!
936
- # time_spent=time.time()
929
+
937
930
collab_ids_new = []
938
931
for collab in collab_ids :
939
932
if is_authorised (request , collab ):
940
933
collab_ids_new .append (collab )
941
- # print("after checking permissions :", time.time()-time_spent)
942
- # time_spent=time.time()
934
+
943
935
all_ctx_from_collab = CollabParameters .objects .filter (collab_id__in = collab_ids_new ).distinct ()
944
936
945
- # print("after getting all ctx :", time.time()-time_spent)
946
- # time_spent=time.time()
947
- #if one of the collab_param is empty, don't filter on it.
937
+
948
938
species_filter = collab_params .species .split ("," )
949
939
if species_filter == [u'' ]:
950
940
species_filter = list (Param_Species .objects .all ().values_list ('authorized_value' , flat = True ))+ [u'' ]
0 commit comments