File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
bco_api/api/scripts/method_specific Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,8 @@ def POST_api_objects_drafts_token(
164164 # import pdb; pdb.set_trace()
165165
166166 published = bco .objects .filter (state = 'PUBLISHED' ).values ()
167- unique_published = []
167+ # unique_published = []
168+ unique_published = set ()
168169
169170 # E.g.
170171 # published[0]["contents"]["object_id"] = 'http://127.0.0.1:8000/BCO_000010/1.0'
@@ -202,9 +203,14 @@ def POST_api_objects_drafts_token(
202203 "bco_object" : p
203204 }
204205 for key , value in bcos .items ():
205- unique_published .append (value ["bco_object" ])
206+ # unique_published.append(value["bco_object"])
207+ # import pdb;pdb.set_trace()
208+ unique_published .add (value ["bco_object" ]["id" ])
209+
210+ # result_list = chain(user_objects.intersection(prefix_objects).values(*return_values), unique_published(*return_values))
211+ unique_published = bco .objects .filter (id__in = unique_published )
212+ result_list = chain (user_objects .intersection (unique_published ).values (* return_values ), prefix_objects .values (* return_values ))
206213
207- result_list = chain (user_objects .intersection (prefix_objects ).values (* return_values ), unique_published )
208214
209215 return Response (
210216 data = result_list ,
You can’t perform that action at this time.
0 commit comments