admin: apply settings to internal structures
This allows scores and rank to be properly generated in admin interface.
This commit is contained in:
parent
8edc8e697c
commit
7edd70c3c0
2 changed files with 12 additions and 0 deletions
|
|
@ -44,10 +44,18 @@ func saveSettings(_ httprouter.Params, body []byte) (interface{}, error) {
|
|||
if err := settings.SaveSettings(path.Join(settings.SettingsDir, settings.SettingsFile), config); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
ApplySettings(config)
|
||||
return config, err
|
||||
}
|
||||
}
|
||||
|
||||
func ApplySettings(config settings.FICSettings) {
|
||||
fic.PartialValidation = config.PartialValidation
|
||||
fic.UnlockedChallenges = !config.EnableExerciceDepend
|
||||
fic.FirstBlood = config.FirstBlood
|
||||
fic.SubmissionCostBase = config.SubmissionCostBase
|
||||
}
|
||||
|
||||
func reset(_ httprouter.Params, body []byte) (interface{}, error) {
|
||||
var m map[string]string
|
||||
if err := json.Unmarshal(body, &m); err != nil {
|
||||
|
|
|
|||
Reference in a new issue