From 5eef6d6ead48acbbef2ecba69d3ad3e55b26d905 Mon Sep 17 00:00:00 2001 From: KiLLuuuhh <74672908+KiLLuuuhh@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:34:03 +0100 Subject: [PATCH] updated the way, users are compared while deletion (#160) * updated the way, users are compared why deletion * added fragments * fixed typo --- changelogs/fragments/160-fix-user-removal.yml | 3 +++ plugins/module_utils/system_access_users_utils.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/160-fix-user-removal.yml diff --git a/changelogs/fragments/160-fix-user-removal.yml b/changelogs/fragments/160-fix-user-removal.yml new file mode 100644 index 00000000..89a31b51 --- /dev/null +++ b/changelogs/fragments/160-fix-user-removal.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - puzzle.opnsense.system_access_users - Thanks to @GBBx fixed a bug while user deletion. \ No newline at end of file diff --git a/plugins/module_utils/system_access_users_utils.py b/plugins/module_utils/system_access_users_utils.py index 547b8735..4bd24e24 100644 --- a/plugins/module_utils/system_access_users_utils.py +++ b/plugins/module_utils/system_access_users_utils.py @@ -934,7 +934,7 @@ def delete(self, user: User) -> None: None: This method does not return a value but updates the internal list of users. """ - self._users = [r for r in self._users if r != user] + self._users = [r for r in self._users if r.name != user.name] def find(self, **kwargs) -> Optional[User]: """