admin: Add setting to differenciate real challenge from common tests
This commit is contained in:
parent
252ff33b83
commit
15c85c8f59
5 changed files with 23 additions and 6 deletions
|
@ -45,7 +45,12 @@ func getROSettings(_ httprouter.Params, body []byte) (interface{}, error) {
|
|||
}
|
||||
|
||||
func getSettings(_ httprouter.Params, body []byte) (interface{}, error) {
|
||||
return settings.ReadSettings(path.Join(settings.SettingsDir, settings.SettingsFile))
|
||||
if s, err := settings.ReadSettings(path.Join(settings.SettingsDir, settings.SettingsFile)); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
s.WorkInProgress = !IsProductionEnv
|
||||
return s, nil
|
||||
}
|
||||
}
|
||||
|
||||
func saveSettings(_ httprouter.Params, body []byte) (interface{}, error) {
|
||||
|
@ -81,6 +86,7 @@ func ResetSettings() error {
|
|||
return settings.SaveSettings(path.Join(settings.SettingsDir, settings.SettingsFile), settings.FICSettings{
|
||||
Title: "Challenge FIC",
|
||||
Authors: "Laboratoire SRS, ÉPITA",
|
||||
WorkInProgress: IsProductionEnv,
|
||||
FirstBlood: fic.FirstBlood,
|
||||
SubmissionCostBase: fic.SubmissionCostBase,
|
||||
ExerciceCurCoefficient: 1,
|
||||
|
|
Reference in a new issue