From ccb7204ec8d42064c22bdf29f503687c8877630a Mon Sep 17 00:00:00 2001 From: CarlosRoca13 Date: Thu, 24 Mar 2022 13:52:24 +0100 Subject: [PATCH] [IMP] users_ldap_populate: black, isort, prettier --- users_ldap_populate/models/users_ldap.py | 10 ++++++++-- users_ldap_populate/tests/test_users_ldap_populate.py | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/users_ldap_populate/models/users_ldap.py b/users_ldap_populate/models/users_ldap.py index a64ed2614e..c60ab4627e 100644 --- a/users_ldap_populate/models/users_ldap.py +++ b/users_ldap_populate/models/users_ldap.py @@ -30,7 +30,8 @@ class CompanyLDAP(models.Model): default=lambda self: [(6, 0, [SUPERUSER_ID])], ) deactivate_unknown_users = fields.Boolean( - string="Deactivate unknown users", default=False, + string="Deactivate unknown users", + default=False, ) def action_populate(self): @@ -142,7 +143,12 @@ def do_deactivate_unknown_users(self, known_user_ids): for unknown_user in users: _logger.debug("checking user %s", unknown_user.login) present_in_ldap = any( - bool(self._get_ldap_entry_dicts(conf, user_name=unknown_user.login,)) + bool( + self._get_ldap_entry_dicts( + conf, + user_name=unknown_user.login, + ) + ) for conf in ldap_confs ) if not present_in_ldap: diff --git a/users_ldap_populate/tests/test_users_ldap_populate.py b/users_ldap_populate/tests/test_users_ldap_populate.py index 03a80f0328..3928812607 100644 --- a/users_ldap_populate/tests/test_users_ldap_populate.py +++ b/users_ldap_populate/tests/test_users_ldap_populate.py @@ -24,8 +24,8 @@ def unbind(self): @contextmanager def patch_ldap(self, results): - """ defuse ldap functions to return fake entries instead of talking to a - server. Use this in your own ldap related tests """ + """defuse ldap functions to return fake entries instead of talking to a + server. Use this in your own ldap related tests""" import ldap original_initialize = ldap.initialize