Update constraints

This commit is contained in:
Lars Westermann 2019-06-10 16:14:53 +02:00
parent 23e042b90c
commit d52ada1726
Signed by: lars.westermann
GPG key ID: 9D417FA5BB9D5E1D

View file

@ -67,8 +67,8 @@ fun checkConstraints(
}
ConstraintType.NotOnDay -> {
val notOnDay = constraints.map { it.day == schedule.day }
if (notOnDay.any()) {
val notOnDay = constraints.map { it.day != schedule.day }
if (notOnDay.none()) {
val dayList = constraints.mapNotNull { it.day }.distinct().sorted()
errors += ConstraintError("Work group requires not days $dayList, but is on ${schedule.day}!")
}