summaryrefslogtreecommitdiff
path: root/internal/api/client/media/mediacreate.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-01-30 16:10:53 +0100
committerLibravatar GitHub <noreply@github.com>2022-01-30 16:10:53 +0100
commit66175c8ad94485338068c264e6b0fb00044e9fd6 (patch)
treed2d5fc96a9af044a84490f49542f3d405a4a174e /internal/api/client/media/mediacreate.go
parentBump nanoid from 3.1.25 to 3.2.0 in /web/gotosocial-styling (#364) (diff)
downloadgotosocial-66175c8ad94485338068c264e6b0fb00044e9fd6.tar.xz
[bug] Fix minimum description length check (#369)
* add/update tests * don't check min description length on media create
Diffstat (limited to 'internal/api/client/media/mediacreate.go')
-rw-r--r--internal/api/client/media/mediacreate.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/internal/api/client/media/mediacreate.go b/internal/api/client/media/mediacreate.go
index 7887461ee..5946ed398 100644
--- a/internal/api/client/media/mediacreate.go
+++ b/internal/api/client/media/mediacreate.go
@@ -149,11 +149,9 @@ func validateCreateMedia(form *model.AttachmentRequest) error {
return fmt.Errorf("file size limit exceeded: limit is %d bytes but attachment was %d bytes", maxSize, form.File.Size)
}
- if len(form.Description) < minDescriptionChars || len(form.Description) > maxDescriptionChars {
+ if len(form.Description) > maxDescriptionChars {
return fmt.Errorf("image description length must be between %d and %d characters (inclusive), but provided image description was %d chars", minDescriptionChars, maxDescriptionChars, len(form.Description))
}
- // TODO: validate focus here
-
return nil
}