WIP: Assign supervisor to student ideas no matter if target (goal) is reached #96

Draft
tozh4728 wants to merge 5 commits from 67-supervisor-target-non-blocking into develop
Showing only changes of commit ce6b5aabdb - Show all commits

View File

@ -207,16 +207,22 @@ public abstract class AbstractAdminIdeaPanel extends Panel {
} else {
ideaService.changeSupervisor(idea, newSelection, SciProSession.get().getUser());
Target currentTarget = targetService.findOne(idea.getApplicationPeriod(), newSelection,
idea.getProjectType());
Long countMatched = ideaService.countMatched(idea.getApplicationPeriod(), newSelection,
idea.getProjectType());
Target currentTarget = targetService.findOne(
idea.getApplicationPeriod(),
newSelection,
idea.getProjectType()
);
Long countMatched = ideaService.countMatched(
idea.getApplicationPeriod(),
newSelection,
idea.getProjectType()
);
int targetCounter = (currentTarget == null) ? 0 : currentTarget.getTarget();
long matchedCounter = (countMatched == null) ? 0L : countMatched;
String msg = "Supervisor changed: matched/target -> " + matchedCounter + " / " +
targetCounter;
String msg =
"Supervisor changed: matched/target -> " + matchedCounter + " / " + targetCounter;
if (matchedCounter > targetCounter) {
warn(msg);