mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 07:46:05 -07:00
Fixed an issue where the admin could not be updated
This commit is contained in:
parent
2dcf573526
commit
b3d1fbda9b
1 changed files with 4 additions and 6 deletions
|
@ -192,8 +192,7 @@ namespace PlexRequests.UI.Modules
|
||||||
{
|
{
|
||||||
localUser.Permissions = permissionsValue;
|
localUser.Permissions = permissionsValue;
|
||||||
localUser.Features = featuresValue;
|
localUser.Features = featuresValue;
|
||||||
|
|
||||||
|
|
||||||
var currentProps = ByteConverterHelper.ReturnObject<UserProperties>(localUser.UserProperties);
|
var currentProps = ByteConverterHelper.ReturnObject<UserProperties>(localUser.UserProperties);
|
||||||
|
|
||||||
// Let's check if the alias has changed, if so we need to change all the requests associated with this
|
// 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)
|
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
|
// 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();
|
var requests = await RequestService.GetAllAsync();
|
||||||
// Update all requests
|
// Update all requests
|
||||||
var requestsWithThisUser = requests.Where(x => x.RequestedUsers.Contains(olderUsername)).ToList();
|
var requestsWithThisUser = requests.Where(x => x.RequestedUsers.Contains(olderUsername)).ToList();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue