Skip to content
Snippets Groups Projects
Commit 22f72bb0 authored by srosse's avatar srosse
Browse files

OO-1071: accept 0 for a new group too

parent 1be6dc0a
No related branches found
No related tags found
No related merge requests found
......@@ -104,10 +104,10 @@ public class BusinessGroupDAO {
SecurityGroup waitingGroup = securityManager.createAndPersistSecurityGroup();
businessgroup = new BusinessGroupImpl(name, description, ownerGroup, participantGroup, waitingGroup);
if(minParticipants != null && minParticipants.intValue() >= 0) {
if(minParticipants != null && minParticipants.intValue() > 0) {
businessgroup.setMinParticipants(minParticipants);
}
if(maxParticipants != null && maxParticipants.intValue() > 0) {
if(maxParticipants != null && maxParticipants.intValue() >= 0) {
businessgroup.setMaxParticipants(maxParticipants);
}
......@@ -143,7 +143,7 @@ public class BusinessGroupDAO {
OLATResource businessgroupOlatResource = olatResourceManager.createOLATResourceInstance(businessgroup);
olatResourceManager.saveOLATResource(businessgroupOlatResource);
businessgroup.setResource(businessgroupOlatResource);
em.merge(businessgroup);
businessgroup = em.merge(businessgroup);
// securityManager.createAndPersistPolicy(ownerGroup, Constants.PERMISSION_ACCESS, businessgroup);
securityManager.createAndPersistPolicyWithResource(ownerGroup, Constants.PERMISSION_ACCESS, businessgroupOlatResource);
......
......@@ -126,7 +126,7 @@ public class BusinessGroupTableModelWithType extends DefaultTableDataModel<BGTab
return wrapped.getBusinessGroupKey().toString();
case freePlaces: {
Integer maxParticipants = wrapped.getMaxParticipants();
if(maxParticipants != null && maxParticipants.intValue() > 0) {
if(maxParticipants != null && maxParticipants.intValue() >= 0) {
long free = maxParticipants - (wrapped.getNumOfParticipants() + wrapped.getNumOfPendings());
return new GroupNumber(free);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment