From 91dca5b53dfc96ee7354e64fd1eccfefae70f608 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 16 Aug 2024 10:54:01 +0800 Subject: [PATCH] Only changes role name if it actual changed. --- .../Volo/Abp/Identity/IdentityRoleAppService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs index 13c79029fae..e6563727bc7 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs +++ b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs @@ -77,7 +77,10 @@ public virtual async Task UpdateAsync(Guid id, IdentityRoleUpda role.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); - (await RoleManager.SetRoleNameAsync(role, input.Name)).CheckErrors(); + if (role.Name != input.Name) + { + (await RoleManager.SetRoleNameAsync(role, input.Name)).CheckErrors(); + } role.IsDefault = input.IsDefault; role.IsPublic = input.IsPublic;