From 9032549f596cf222c7455ce501aaf15b2d456219 Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 13 Mar 2023 13:39:09 +0100 Subject: [PATCH] SEBSERV-399 fixed --- .../servicelayer/dao/impl/ConfigurationNodeDAOImpl.java | 4 ++-- .../servicelayer/sebconfig/impl/ExamConfigServiceImpl.java | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java index 6e3e6409..5283e262 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java @@ -402,13 +402,13 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO { isEqualTo(data.name)) .and( ConfigurationNodeRecordDynamicSqlSupport.type, - isNotEqualTo(data.type.name())) + isEqualTo(data.type.name())) .and( ConfigurationNodeRecordDynamicSqlSupport.id, isNotEqualTo(data.id)) .and( ConfigurationNodeRecordDynamicSqlSupport.institutionId, - isNotEqualTo(data.institutionId)) + isEqualTo(data.institutionId)) .build() .execute(); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigServiceImpl.java index a1b08949..84457059 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigServiceImpl.java @@ -36,6 +36,7 @@ import ch.ethz.seb.sebserver.gbl.model.sebconfig.Configuration; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationAttribute; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode.ConfigurationStatus; +import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode.ConfigurationType; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationTableValues; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationValue; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; @@ -426,6 +427,11 @@ public class ExamConfigServiceImpl implements ExamConfigService { "The Type of ConfigurationNode cannot change after creation"); } + if (configurationNode.type == ConfigurationType.TEMPLATE) { + // No configuration template specific checks for now + return configurationNode; + } + // if configuration is in use, "Ready to Use" is not possible if (configurationNode.status == ConfigurationStatus.READY_TO_USE) { if (!this.examConfigurationMapDAO