Ensures the user validator doesn't execute unless the username or email addres is changed (since that is all the validator validates)

This commit is contained in:
Shannon
2017-07-28 12:20:10 +10:00
parent fdf206038a
commit 960cc32da1

View File

@@ -19,7 +19,7 @@ namespace Umbraco.Core.Security
public override async Task<IdentityResult> ValidateAsync(T item)
{
//Don't validate if the user's email or username hasn't changed otherwise it's just wasting SQL queries.
if (((ICanBeDirty)item).IsDirty())
if (item.IsPropertyDirty("Email") || item.IsPropertyDirty("UserName"))
{
return await base.ValidateAsync(item);
}