From 650afac0900f67e99e7b3b96a93c097b28dec12c Mon Sep 17 00:00:00 2001 From: Pavel Kunyavskiy Date: Sat, 4 Nov 2023 12:33:29 +0100 Subject: [PATCH] Support using overridden customFields in templates --- .../icpclive/cds/adapters/AdvancedPropertiesAdapter.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cds/src/main/kotlin/org/icpclive/cds/adapters/AdvancedPropertiesAdapter.kt b/src/cds/src/main/kotlin/org/icpclive/cds/adapters/AdvancedPropertiesAdapter.kt index 4c2b46690..884be9893 100644 --- a/src/cds/src/main/kotlin/org/icpclive/cds/adapters/AdvancedPropertiesAdapter.kt +++ b/src/cds/src/main/kotlin/org/icpclive/cds/adapters/AdvancedPropertiesAdapter.kt @@ -251,10 +251,12 @@ internal fun applyAdvancedProperties( } } + val teamInfoWithCustomFields = teamInfosPrelim + .mergeTeams(overrides.teamOverrides?.filterValues { it.customFields != null }?.mapValues { TeamInfoOverride(customFields = it.value.customFields) }) - @Suppress("DEPRECATION") val teamInfos = teamInfosPrelim - .mergeTeams(overrides.teamMediaTemplate?.instantiateTemplate(teamInfosPrelim, TeamInfo::templateValueGetter)) - .mergeTeams(overrides.teamOverrideTemplate?.instantiateTemplate(teamInfosPrelim, TeamInfo::templateValueGetter)) + @Suppress("DEPRECATION") val teamInfos = teamInfoWithCustomFields + .mergeTeams(overrides.teamMediaTemplate?.instantiateTemplate(teamInfoWithCustomFields, TeamInfo::templateValueGetter)) + .mergeTeams(overrides.teamOverrideTemplate?.instantiateTemplate(teamInfoWithCustomFields, TeamInfo::templateValueGetter)) .mergeTeams(overrides.teamOverrides) val problemInfos = mergeProblems(info.problemList, overrides.problemOverrides)