mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: update display name validation to allow spaces and improve error message
This commit is contained in:
@@ -33,7 +33,7 @@ namespace SharpbinV3.Server.DTOs
|
|||||||
if (!ValidateDisplayname().IsMatch(DisplayName))
|
if (!ValidateDisplayname().IsMatch(DisplayName))
|
||||||
results.Add(new ValidationResult("DisplayName can only contain alphanumeric characters, underscores, periods, and spaces (no leading or trailing spaces).", [nameof(DisplayName)]));
|
results.Add(new ValidationResult("DisplayName can only contain alphanumeric characters, underscores, periods, and spaces (no leading or trailing spaces).", [nameof(DisplayName)]));
|
||||||
}
|
}
|
||||||
if (Email != null)
|
if (Email != null && Email.Length > 0)
|
||||||
{
|
{
|
||||||
var emailAttribute = new EmailAddressAttribute();
|
var emailAttribute = new EmailAddressAttribute();
|
||||||
if (!emailAttribute.IsValid(Email))
|
if (!emailAttribute.IsValid(Email))
|
||||||
|
|||||||
Reference in New Issue
Block a user