only check if partner participating on another idea if it is a new idea. otherwise validation fails since the partner participating on the current indea

This commit is contained in:
Emil Siverhall 2012-09-27 14:13:14 +02:00
parent 4b24ec2cd2
commit 7424a98019

@ -251,11 +251,16 @@ public class ProjectIdeaSubmissionPanel extends Panel {
validated=false;
}
if (partnerAdditionPanel.coAuthorExists()) {
//Check to see if partner already is part of another idea.
if(supervisorIdeaService.authorParticipatingOnIdea(partnerAdditionPanel.getCoAuthor())){
error("Your project partner is already part of another project idea");
validated = false;
if(idea.getId()==null) {
//We only do this check if it is a new project idea. If editing, author is participating on THIS idea, so validation fails.
if(supervisorIdeaService.authorParticipatingOnIdea(partnerAdditionPanel.getCoAuthor())){
error("Your project partner is already part of another project idea");
validated = false;
}
}
//Check to see if partner already is part of another idea.
//Check to see if the submitter tries to add himself.
if(!partnerAdditionPanel.getCoAuthor().equals(signedInAuthor)) {
idea.getAuthors().clear();