From c98e4390b12e3c0754161c4e8cbba13d41f2e3c1 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 30 Mar 2023 00:15:21 +0200 Subject: [PATCH] fix: validate WordStatus correctly, raise field entry length limit to 100 --- backend/db/entries.go | 4 ++-- backend/db/field.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/db/entries.go b/backend/db/entries.go index f9f9d3c..9a2c28f 100644 --- a/backend/db/entries.go +++ b/backend/db/entries.go @@ -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))) } - if fe.Status.Valid() { + if !fe.Status.Valid() { 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))) } - if p.Status.Valid() { + if !p.Status.Valid() { return "status is invalid" } diff --git a/backend/db/field.go b/backend/db/field.go index bbf0d5b..7ec2896 100644 --- a/backend/db/field.go +++ b/backend/db/field.go @@ -14,7 +14,7 @@ const ( MaxFields = 25 FieldNameMaxLength = 100 FieldEntriesLimit = 100 - FieldEntryMaxLength = 50 + FieldEntryMaxLength = 100 ) type Field struct {