Skip to content

Commit 97deb21

Browse files
authored
Merge pull request #348 from VariantEffect/estelle/notAllowAddScoreSetInMetaAnalysisExp
Not allowing adding score set to meta-analysis experiment.
2 parents e8e1c48 + 9f25dc5 commit 97deb21

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mavedb/routers/score_sets.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ async def create_score_set(
334334
msg="Failed to create score set; The requested experiment does not exist.", extra=logging_context()
335335
)
336336
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="Unknown experiment")
337+
# Not allow add score set in meta-analysis experiments.
338+
if any(s.meta_analyzes_score_sets for s in experiment.score_sets):
339+
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN,
340+
detail="Score sets may not be added to a meta-analysis experiment.")
337341

338342
save_to_logging_context({"experiment": experiment.urn})
339343
assert_permission(user_data, experiment, Action.ADD_SCORE_SET)
@@ -386,7 +390,7 @@ async def create_score_set(
386390
)
387391

388392
if len(meta_analyzes_score_sets) > 0:
389-
# If any existing score set is a meta-analysis for score sets in the same collection of exepriment sets, use its
393+
# If any existing score set is a meta-analysis for score sets in the same collection of experiment sets, use its
390394
# experiment as the parent of our new meta-analysis. Otherwise, create a new experiment.
391395
meta_analyzes_experiment_sets = list(
392396
set(

0 commit comments

Comments
 (0)