mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 13:02:26 -06:00
[bug] Fix minimum description length check (#369)
* add/update tests * don't check min description length on media create
This commit is contained in:
parent
664927ea58
commit
66175c8ad9
3 changed files with 329 additions and 15 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue