Unverified Commit 511cc29f authored by Jhoan Manuel Muñoz Serrano's avatar Jhoan Manuel Muñoz Serrano Committed by GitHub

Pivotal ID # 173354960: Duplicated AttachTo Attribute (#142)

- Fix the condition to avoid duplicating the AttachTo attribute
- Add test scenario
parent fac4bca5
Pipeline #82060 passed with stages
in 6 minutes and 37 seconds
......@@ -84,7 +84,7 @@ public class SubmissionService {
return;
}
if (subAttributes.stream().noneMatch(attribute -> attribute.getName().equals(accessTag))) {
if (subAttributes.stream().noneMatch(attribute -> attribute.getValue().equals(accessTag))) {
subAttributes.add(new Attribute("AttachTo", accessTag));
}
}
......
......@@ -3,3 +3,4 @@ INSERT INTO User (activationKey, active, auxProfileInfo, email, fullName, keyTim
-- AccessTags
INSERT INTO AccessTag (id, description, name, owner_id, parent_tag_id) VALUES (1, null, 'Public', 1, null);
INSERT INTO AccessTag (id, description, name, owner_id, parent_tag_id) VALUES (2, null, 'BioImages', 1, null);
......@@ -4,6 +4,9 @@ VALUES (1460402396, 1460402396, 1460402396, 'S-EPMC2873748', 'S-EPMC/S-EPMCxxx74
INSERT INTO SubmissionAttribute(name, reference, value, submission_id, ord) VALUES('AttachTo', 0, 'BioImages', 1, 0);
-- Submission Access Tag
INSERT INTO Submission_AccessTag (Submission_id, accessTags_id) VALUES (1, 2);
-- Sections
INSERT INTO Section (accNo, parentAccNo, tableIndex, type, parent_id, submission_id, ord)
VALUES (null, null, -1, 'Study', null, 1, null);
......
......@@ -13,7 +13,8 @@
"filesCount": 1,
"accessTags":[
"biostudies-dev@ebi.ac.uk",
"#1"
"#1",
"BioImages"
],
"attributes":[
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment