File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -60,13 +60,14 @@ def batch(self, with_valid=True):
6060 if with_valid :
6161 self .is_valid (raise_exception = True )
6262 problem_list = self .data .get ('problem_list' )
63+ problem_list = list (set (problem_list ))
6364 dataset_id = self .data .get ('dataset_id' )
6465 exists_problem_content_list = [problem .content for problem in
6566 QuerySet (Problem ).filter (dataset_id = dataset_id ,
6667 content__in = problem_list )]
6768 problem_instance_list = [Problem (id = uuid .uuid1 (), dataset_id = dataset_id , content = problem_content ) for
6869 problem_content in
69- self . data . get ( ' problem_list' ) if
70+ problem_list if
7071 (not exists_problem_content_list .__contains__ (problem_content ) if
7172 len (exists_problem_content_list ) > 0 else True )]
7273
@@ -122,7 +123,7 @@ def list_paragraph(self, with_valid=True):
122123 self .is_valid (raise_exception = True )
123124 problem_paragraph_mapping = QuerySet (ProblemParagraphMapping ).filter (dataset_id = self .data .get ("dataset_id" ),
124125 problem_id = self .data .get ("problem_id" ))
125- if problem_paragraph_mapping is None or len (problem_paragraph_mapping )== 0 :
126+ if problem_paragraph_mapping is None or len (problem_paragraph_mapping ) == 0 :
126127 return []
127128 return native_search (
128129 QuerySet (Paragraph ).filter (id__in = [row .paragraph_id for row in problem_paragraph_mapping ]),
You can’t perform that action at this time.
0 commit comments