admin: add a button to edit the raw flag value instead of the checksum
This commit is contained in:
parent
b205409679
commit
eee2cd6a2f
4 changed files with 46 additions and 18 deletions
|
@ -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 {
|
||||
|
|
Reference in a new issue