admin: add a button to edit the raw flag value instead of the checksum

This commit is contained in:
nemunaire 2019-01-21 13:35:09 +01:00
parent b205409679
commit eee2cd6a2f
4 changed files with 46 additions and 18 deletions

View file

@ -332,7 +332,15 @@ func updateExerciceFlag(flag fic.FlagKey, exercice fic.Exercice, body []byte) (i
flag.Help = uk.Help
flag.IgnoreCase = uk.IgnoreCase
flag.Checksum = uk.Value
if len(uk.Flag) > 0 {
var err error
flag.Checksum, err = flag.ComputeChecksum([]byte(uk.Flag))
if err != nil {
return nil, err
}
} else {
flag.Checksum = uk.Value
}
flag.ChoicesCost = uk.ChoicesCost
if uk.ValidatorRe != nil && len(*uk.ValidatorRe) > 0 {