aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Lavado <anthony@lavado.ca>2020-07-18 23:04:14 -0400
committerGitHub <noreply@github.com>2020-07-18 23:04:14 -0400
commit8ac08499bc47caf17d029fe10605da6c335a48e5 (patch)
treed05dcc0710335ac14ec481533d8833080f3f22f2
parent6e1735d31120222e0873e9d48c4bc07295e31950 (diff)
parent2f38d9700cd6f6e80976d2bfe320d1a829a8eed4 (diff)
Merge pull request #3587 from crobibero/user-update-policy
fix UserManager UpdatePolicy
-rw-r--r--Jellyfin.Server.Implementations/Users/UserManager.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs
index 9aff808db..e3a7d5467 100644
--- a/Jellyfin.Server.Implementations/Users/UserManager.cs
+++ b/Jellyfin.Server.Implementations/Users/UserManager.cs
@@ -671,7 +671,13 @@ namespace Jellyfin.Server.Implementations.Users
public void UpdatePolicy(Guid userId, UserPolicy policy)
{
var dbContext = _dbProvider.CreateContext();
- var user = dbContext.Users.Find(userId) ?? throw new ArgumentException("No user exists with given Id!");
+ var user = dbContext.Users
+ .Include(u => u.Permissions)
+ .Include(u => u.Preferences)
+ .Include(u => u.AccessSchedules)
+ .Include(u => u.ProfileImage)
+ .FirstOrDefault(u => u.Id == userId)
+ ?? throw new ArgumentException("No user exists with given Id!");
// The default number of login attempts is 3, but for some god forsaken reason it's sent to the server as "0"
int? maxLoginAttempts = policy.LoginAttemptsBeforeLockout switch