diff --git a/src/npg_irods/metadata/lims.py b/src/npg_irods/metadata/lims.py index c618df07..384369ed 100644 --- a/src/npg_irods/metadata/lims.py +++ b/src/npg_irods/metadata/lims.py @@ -168,7 +168,9 @@ def make_reduced_study_metadata(study: Study) -> list[AVU]: return [avu_if_value(TrackedStudy.ID, study.id_study_lims)] -def make_sample_acl(seq:SeqConcept, sample: Sample, study: Study, zone=None) -> list[AC]: +def make_sample_acl( + seq: SeqConcept, sample: Sample, study: Study, zone=None +) -> list[AC]: """Returns an ACL for a given Sample in a Study. This method takes into account all factors influencing access control, which are: @@ -197,7 +199,11 @@ def make_sample_acl(seq:SeqConcept, sample: Sample, study: Study, zone=None) -> irods_group = f"{STUDY_IDENTIFIER_PREFIX}{study.id_study_lims}_human" else: irods_group = f"{STUDY_IDENTIFIER_PREFIX}{study.id_study_lims}" - perm = Permission.NULL if sample.consent_withdrawn or (seq is not None and seq.value == "xahuman") else Permission.READ + perm = ( + Permission.NULL + if sample.consent_withdrawn or (seq is not None and seq.value == "xahuman") + else Permission.READ + ) return [AC(irods_group, perm, zone=zone)] diff --git a/tests/conftest.py b/tests/conftest.py index 832bb0f1..e7520c16 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1031,8 +1031,12 @@ def illumina_synthetic_irods(tmp_path): ), "12345/12345#1_xahuman.cram": ( AVU(idp, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"), - AVU(cmp, '{"id_run":12345, "position":1, "tag_index":1, "subset":"xahuman"}'), - AVU(cmp, '{"id_run":12345, "position":2, "tag_index":1, "subset":"xahuman"}'), + AVU( + cmp, '{"id_run":12345, "position":1, "tag_index":1, "subset":"xahuman"}' + ), + AVU( + cmp, '{"id_run":12345, "position":2, "tag_index":1, "subset":"xahuman"}' + ), *run_pos, AVU(tag, 1), ), diff --git a/tests/test_illumina.py b/tests/test_illumina.py index 98012d86..035f61e9 100644 --- a/tests/test_illumina.py +++ b/tests/test_illumina.py @@ -427,7 +427,7 @@ def test_updates_human_permissions_mx( ] new_permissions = [ AC("irods", perm=Permission.OWN, zone=zone), - AC("ss_4000_human", perm=Permission.READ, zone=zone), + AC("ss_4000_human", perm=Permission.READ, zone=zone), ] for obj in [DataObject(path), DataObject(qc_path)]: