Convert visibility to number (#29226)

Don't throw error while creating user (Fixes #29218)

(cherry picked from commit 6093f507fe6f2d4802de8ec1ff5b04820e81571c)
This commit is contained in:
Tim-Nicas Oelschläger 2024-02-18 12:47:50 +01:00 committed by Earl Warren
parent d93d963c3f
commit 559afdad73
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -26,7 +26,7 @@
<div class="inline field {{if .Err_Visibility}}error{{end}}"> <div class="inline field {{if .Err_Visibility}}error{{end}}">
<span class="inline required field"><label for="visibility">{{ctx.Locale.Tr "settings.visibility"}}</label></span> <span class="inline required field"><label for="visibility">{{ctx.Locale.Tr "settings.visibility"}}</label></span>
<div class="ui selection type dropdown"> <div class="ui selection type dropdown">
<input type="hidden" id="visibility" name="visibility" value="{{if .visibility}}{{.visibility}}{{else}}{{printf "%d" .DefaultUserVisibilityMode}}{{end}}"> <input type="hidden" id="visibility" name="visibility" value="{{if .visibility}}{{printf "%d" .visibility}}{{else}}{{printf "%d" .DefaultUserVisibilityMode}}{{end}}">
<div class="text"> <div class="text">
{{if .DefaultUserVisibilityMode.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}} {{if .DefaultUserVisibilityMode.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}}
{{if .DefaultUserVisibilityMode.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}} {{if .DefaultUserVisibilityMode.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}}