Skip to content

Commit 35e98ec

Browse files
committed
Convert duplicate-study results to bare study IDs
This should restore proper our check for duplicates study IDs, which was mangled during Pyramid conversion and subsequent refactoring.
1 parent 39f34e0 commit 35e98ec

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • phylesystem_api/phylesystem_api/views

phylesystem_api/phylesystem_api/views/study.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,13 @@ def _fetch_duplicate_study_ids(request, study_DOI=None, study_ID=None):
182182
duplicate_study_ids = oti.find_studies(
183183
{"ot:studyPublication": study_DOI}, verbose=False, exact=True
184184
)
185+
# strip the list to just include bare study IDs
186+
duplicate_study_ids = [x['ot:studyId'] for x in duplicate_study_ids]
185187
try:
186188
duplicate_study_ids.remove(study_ID)
187189
except ValueError:
188190
# ignore error, if oti is lagging and doesn't have this study yet
189191
pass
190-
pass
191192
return duplicate_study_ids
192193

193194

0 commit comments

Comments
 (0)