fix: allow clearing display name in profile settings
- Remove restriction that prevented setting display_name to empty - Users can now clear display name to fall back to username display - Trim whitespace from display_name input Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+3
-3
@@ -72,9 +72,9 @@ func UpdateProfile(db *gorm.DB, storagePath string) gin.HandlerFunc {
|
||||
}
|
||||
|
||||
// --- Text fields ---
|
||||
if v := c.PostForm("display_name"); v != "" {
|
||||
user.DisplayName = v
|
||||
}
|
||||
// Allow empty display_name (user can clear it to fall back to username)
|
||||
user.DisplayName = strings.TrimSpace(c.PostForm("display_name"))
|
||||
|
||||
if v := c.PostForm("gender"); v != "" {
|
||||
user.Gender = v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user