summaryrefslogtreecommitdiff
path: root/internal/processing/account/update.go
diff options
context:
space:
mode:
authorLibravatar Vyr Cossont <VyrCossont@users.noreply.github.com>2023-08-07 01:25:54 -0700
committerLibravatar GitHub <noreply@github.com>2023-08-07 10:25:54 +0200
commit0f812746b7fd9dfeef41e329af5215772672689a (patch)
treeadfc0c9e4412982224d32019b8abfc2895cd3f66 /internal/processing/account/update.go
parent[chore]: Bump golang.org/x/oauth2 from 0.10.0 to 0.11.0 (#2076) (diff)
downloadgotosocial-0f812746b7fd9dfeef41e329af5215772672689a.tar.xz
[feature] Allow full BCP 47 in language inputs (#2067)
* Allow full BCP 47 in language inputs Fixes #2066 * Fuse validation and normalization for languages * Remove outdated comment line * Move post language canonicalization test
Diffstat (limited to 'internal/processing/account/update.go')
-rw-r--r--internal/processing/account/update.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/processing/account/update.go b/internal/processing/account/update.go
index 01c62d7e3..f75b3c8d9 100644
--- a/internal/processing/account/update.go
+++ b/internal/processing/account/update.go
@@ -222,10 +222,11 @@ func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, form
if form.Source != nil {
if form.Source.Language != nil {
- if err := validate.Language(*form.Source.Language); err != nil {
+ language, err := validate.Language(*form.Source.Language)
+ if err != nil {
return nil, gtserror.NewErrorBadRequest(err)
}
- account.Language = *form.Source.Language
+ account.Language = language
}
if form.Source.Sensitive != nil {