fix user multioption test

This commit is contained in:
Peter Hormanns 2021-08-18 19:01:06 +02:00
parent 3605f0da4b
commit 1db36a61f1

View File

@ -135,11 +135,11 @@ public class UnixUserModuleImpl extends AbstractModuleImpl {
throw new HSAdminException("not allowed for this packet type");
}
//TODO: Needs better implementation
Query qUnixUsers = em.createQuery("SELECT obj FROM UnixUsers obj WHERE obj.id = :pacId");
Query qUnixUsers = em.createQuery("SELECT obj FROM UnixUsers obj WHERE obj.pac.id = :pacId");
qUnixUsers.setParameter("pacId", pac.getId());
if (qUnixUsers.getResultList().size() >= MultiOption.UNIXUSERS_PER_OPTION * pac.getQuantityByComponentName("MULTI")) {
throw new HSAdminException("included unix users exceeded");
}
}
// don't move this up, it will update the new entity still with wrong
// userid!
newUnixUser.setPac(pac);