From b3d1fbda9b5b3199561dbc892e43c30dc56de34c Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 9 Dec 2016 13:34:42 +0000 Subject: [PATCH] Fixed an issue where the admin could not be updated --- PlexRequests.UI/Modules/UserManagementModule.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/PlexRequests.UI/Modules/UserManagementModule.cs b/PlexRequests.UI/Modules/UserManagementModule.cs index 4fc7b8d9d..cf7669a57 100644 --- a/PlexRequests.UI/Modules/UserManagementModule.cs +++ b/PlexRequests.UI/Modules/UserManagementModule.cs @@ -192,8 +192,7 @@ namespace PlexRequests.UI.Modules { localUser.Permissions = permissionsValue; localUser.Features = featuresValue; - - + var currentProps = ByteConverterHelper.ReturnObject(localUser.UserProperties); // Let's check if the alias has changed, if so we need to change all the requests associated with this @@ -256,12 +255,11 @@ namespace PlexRequests.UI.Modules private async Task UpdateRequests(string username, string oldAlias, string newAlias) { + var newUsername = string.IsNullOrEmpty(newAlias) ? username : newAlias; // User the username if we are clearing the alias + var olderUsername = string.IsNullOrEmpty(oldAlias) ? username : oldAlias; // Let's check if the alias has changed, if so we need to change all the requests associated with this - if (!oldAlias.Equals(newAlias, StringComparison.CurrentCultureIgnoreCase)) + if (!olderUsername.Equals(newUsername, StringComparison.CurrentCultureIgnoreCase)) { - var newUsername = string.IsNullOrEmpty(newAlias) ? username : newAlias; // User the username if we are clearing the alias - var olderUsername = string.IsNullOrEmpty(oldAlias) ? username : oldAlias; - var requests = await RequestService.GetAllAsync(); // Update all requests var requestsWithThisUser = requests.Where(x => x.RequestedUsers.Contains(olderUsername)).ToList();