Rename ValidatorRegexp to CaptureRegexp
This commit is contained in:
parent
e472b482d6
commit
78189aab37
5 changed files with 58 additions and 58 deletions
|
|
@ -730,7 +730,7 @@ type uploadedFlag struct {
|
|||
IgnoreCase bool
|
||||
Multiline bool
|
||||
NoTrim bool
|
||||
ValidatorRe *string `json:"validator_regexp"`
|
||||
CaptureRe *string `json:"validator_regexp"`
|
||||
SortReGroups bool `json:"sort_re_grps"`
|
||||
Flag string
|
||||
Value []byte
|
||||
|
|
@ -752,8 +752,8 @@ func createExerciceFlag(c *gin.Context) {
|
|||
}
|
||||
|
||||
var vre *string = nil
|
||||
if uk.ValidatorRe != nil && len(*uk.ValidatorRe) > 0 {
|
||||
vre = uk.ValidatorRe
|
||||
if uk.CaptureRe != nil && len(*uk.CaptureRe) > 0 {
|
||||
vre = uk.CaptureRe
|
||||
}
|
||||
|
||||
exercice := c.MustGet("exercice").(*fic.Exercice)
|
||||
|
|
@ -842,10 +842,10 @@ func updateExerciceFlag(c *gin.Context) {
|
|||
flag.ChoicesCost = uk.ChoicesCost
|
||||
flag.BonusGain = uk.BonusGain
|
||||
|
||||
if uk.ValidatorRe != nil && len(*uk.ValidatorRe) > 0 {
|
||||
flag.ValidatorRegexp = uk.ValidatorRe
|
||||
if uk.CaptureRe != nil && len(*uk.CaptureRe) > 0 {
|
||||
flag.CaptureRegexp = uk.CaptureRe
|
||||
} else {
|
||||
flag.ValidatorRegexp = nil
|
||||
flag.CaptureRegexp = nil
|
||||
}
|
||||
|
||||
if _, err := flag.Update(); err != nil {
|
||||
|
|
|
|||
Reference in a new issue