1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-28 23:07:13 -04:00

New: Improve validation messages

(cherry picked from commit a117001de673e80abd90d54a34a7c86292b3a649)
This commit is contained in:
Bogdan
2023-05-20 22:22:04 +03:00
parent aa794bddab
commit 933c23ce57
14 changed files with 43 additions and 19 deletions
+3 -1
View File
@@ -14,7 +14,7 @@ namespace NzbDrone.Core.Validation
public class UrlValidator : PropertyValidator
{
protected override string GetDefaultMessageTemplate() => "Invalid Url";
protected override string GetDefaultMessageTemplate() => "Invalid Url: '{url}'";
protected override bool IsValid(PropertyValidatorContext context)
{
@@ -23,6 +23,8 @@ namespace NzbDrone.Core.Validation
return false;
}
context.MessageFormatter.AppendArgument("url", context.PropertyValue.ToString());
return context.PropertyValue.ToString().IsValidUrl();
}
}