automatic group size for ogra
Co-Authored-By: Talha Caliskan <killerber4t@users.noreply.github.com>
This commit is contained in:
@ -97,6 +97,9 @@ public class Gruppen2Controller {
|
|||||||
if (!file.isEmpty()) {
|
if (!file.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
userList = CsvService.read(file.getInputStream());
|
userList = CsvService.read(file.getInputStream());
|
||||||
|
if(userList.size() > userMaximum){
|
||||||
|
userMaximum = Long.valueOf(userList.size()) + userMaximum;
|
||||||
|
}
|
||||||
} catch (UnrecognizedPropertyException | CharConversionException ex) {
|
} catch (UnrecognizedPropertyException | CharConversionException ex) {
|
||||||
throw new WrongFileException(file.getOriginalFilename());
|
throw new WrongFileException(file.getOriginalFilename());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ public class AddUserEvent extends Event {
|
|||||||
if (group.getMembers().contains(user)) {
|
if (group.getMembers().contains(user)) {
|
||||||
throw new UserAlreadyExistsException(this.getClass().toString());
|
throw new UserAlreadyExistsException(this.getClass().toString());
|
||||||
}
|
}
|
||||||
//andere exception
|
|
||||||
if (group.getMembers().size() == group.getUserMaximum()){
|
if (group.getMembers().size() == group.getUserMaximum()){
|
||||||
throw new GroupFullException(this.getClass().toString());
|
throw new GroupFullException(this.getClass().toString());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user