1

automatic group size for ogra

Co-Authored-By: Talha Caliskan <killerber4t@users.noreply.github.com>
This commit is contained in:
tomvahl
2020-03-20 15:57:16 +01:00
parent b6c013e254
commit ef946c9f82
2 changed files with 4 additions and 1 deletions

View File

@ -97,6 +97,9 @@ public class Gruppen2Controller {
if (!file.isEmpty()) {
try {
userList = CsvService.read(file.getInputStream());
if(userList.size() > userMaximum){
userMaximum = Long.valueOf(userList.size()) + userMaximum;
}
} catch (UnrecognizedPropertyException | CharConversionException ex) {
throw new WrongFileException(file.getOriginalFilename());
}

View File

@ -36,7 +36,7 @@ public class AddUserEvent extends Event {
if (group.getMembers().contains(user)) {
throw new UserAlreadyExistsException(this.getClass().toString());
}
//andere exception
if (group.getMembers().size() == group.getUserMaximum()){
throw new GroupFullException(this.getClass().toString());
}