fix: validate WordStatus correctly, raise field entry length limit to 100

This commit is contained in:
Sam 2023-03-30 00:15:21 +02:00
parent 96376516b0
commit c98e4390b1
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
2 changed files with 3 additions and 3 deletions

View file

@ -67,7 +67,7 @@ func (fe FieldEntry) Validate() string {
return fmt.Sprintf("name must be %d characters or less, is %d", FieldEntryMaxLength, len([]rune(fe.Value))) return fmt.Sprintf("name must be %d characters or less, is %d", FieldEntryMaxLength, len([]rune(fe.Value)))
} }
if fe.Status.Valid() { if !fe.Status.Valid() {
return "status is invalid" return "status is invalid"
} }
@ -95,7 +95,7 @@ func (p PronounEntry) Validate() string {
return fmt.Sprintf("pronouns must be %d characters or less, is %d", FieldEntryMaxLength, len([]rune(p.Pronouns))) return fmt.Sprintf("pronouns must be %d characters or less, is %d", FieldEntryMaxLength, len([]rune(p.Pronouns)))
} }
if p.Status.Valid() { if !p.Status.Valid() {
return "status is invalid" return "status is invalid"
} }

View file

@ -14,7 +14,7 @@ const (
MaxFields = 25 MaxFields = 25
FieldNameMaxLength = 100 FieldNameMaxLength = 100
FieldEntriesLimit = 100 FieldEntriesLimit = 100
FieldEntryMaxLength = 50 FieldEntryMaxLength = 100
) )
type Field struct { type Field struct {