From: Côme Chilliet Date: Tue, 23 May 2023 15:18:19 +0000 (+0200) Subject: Fix user tests, avoid setting enabled state to the same value X-Git-Tag: v28.0.0beta1~791^2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=285c42ab14199ab1c6a5f32cf1590e7a0aa3be49;p=nextcloud-server.git Fix user tests, avoid setting enabled state to the same value Signed-off-by: Côme Chilliet --- diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 8830b4aae71..3b7123bd575 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -467,10 +467,11 @@ class User implements IUser { return (bool) $this->enabled; }; $this->backend->setUserEnabled($this->uid, $enabled, $queryDatabaseValue, $setDatabaseValue); - } else { + if ($oldStatus !== $enabled) { + $this->triggerChange('enabled', $enabled, $oldStatus); + } + } elseif ($oldStatus !== $enabled) { $setDatabaseValue($enabled); - } - if ($oldStatus !== $enabled) { $this->triggerChange('enabled', $enabled, $oldStatus); } }