3122 tr fIX Stöd för manuell hantering av slutsem för handledare

This commit is contained in:
Wayne Westmoreland 2024-01-18 10:48:31 +01:00
parent f447c7db11
commit 4d58f2b31b
3 changed files with 5 additions and 5 deletions
core/src/main/java/se/su/dsv/scipro/finalseminar
view/src/main/java/se/su/dsv/scipro/finalseminar

@ -270,9 +270,9 @@ public class FinalSeminarServiceImpl extends AbstractServiceImpl<FinalSeminar, L
@Transactional
public Either<OpposeError, FinalSeminarOpposition> attemptAddOppositionAsSupervisor(User student, FinalSeminar finalSeminar, Project project) {
if (finalSeminar.getActiveParticipants().contains(student)) {
return Either.left(OpposeError.AlreadyParticipant);
return Either.left(OpposeError.ALREADY_PARTICIPANT);
} else if (finalSeminar.getOpponents().contains(student)) {
return Either.left(OpposeError.AlreadyOpponent);
return Either.left(OpposeError.ALREADY_OPPONENT);
} else {
return Either.right(createAndSaveOpposition(student, finalSeminar, project));
}

@ -1,5 +1,5 @@
package se.su.dsv.scipro.finalseminar;
public enum OpposeError {
AlreadyOpponent, AlreadyParticipant
ALREADY_OPPONENT, ALREADY_PARTICIPANT
}

@ -261,9 +261,9 @@ public class SeminarCRUDPanel extends GenericPanel<FinalSeminar> {
result.fold(
error -> {
switch (error) {
case AlreadyOpponent ->
case ALREADY_OPPONENT ->
error(potentialOpponent.getFullName() + " that you selected as an opponent is already an opponent");
case AlreadyParticipant ->
case ALREADY_PARTICIPANT ->
error(potentialOpponent.getFullName() + " that you selected as an opponent is already an active participant");
}
return false;