From 426cef998fc5cebbfbec3adfa71f84840cd860d4 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 3 Dec 2021 18:39:42 +0100 Subject: [PATCH] sources/ldap: make task names more consistent Signed-off-by: Jens Langhammer --- authentik/crypto/tests.py | 5 +++-- authentik/sources/ldap/tasks.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/authentik/crypto/tests.py b/authentik/crypto/tests.py index 59a1d1094..112083698 100644 --- a/authentik/crypto/tests.py +++ b/authentik/crypto/tests.py @@ -1,6 +1,6 @@ """Crypto tests""" import datetime -from os import makedirs, mkdir +from os import makedirs from tempfile import TemporaryDirectory from django.urls import reverse @@ -189,7 +189,8 @@ class TestCrypto(APITestCase): with open(f"{temp_dir}/foo.bar/privkey.pem", "w+", encoding="utf-8") as _key: _key.write(builder.private_key) with CONFIG.patch("cert_discovery_dir", temp_dir): - certificate_discovery() + # pyright: reportGeneralTypeIssues=false + certificate_discovery() # pylint: disable=no-value-for-parameter self.assertTrue( CertificateKeyPair.objects.filter(managed=MANAGED_DISCOVERED % "foo").exists() ) diff --git a/authentik/sources/ldap/tasks.py b/authentik/sources/ldap/tasks.py index b431c4a98..d83786e2f 100644 --- a/authentik/sources/ldap/tasks.py +++ b/authentik/sources/ldap/tasks.py @@ -39,7 +39,7 @@ def ldap_sync(self: MonitoredTask, source_pk: str, sync_class: str): # to set the state with return sync = path_to_class(sync_class) - self.set_uid(f"{slugify(source.name)}-{sync.__name__}") + self.set_uid(f"{slugify(source.name)}_{sync.__name__.replace('LDAPSynchronizer', '').lower()}") try: sync_inst = sync(source) count = sync_inst.sync()