*: fix formatting

This commit is contained in:
Jens Langhammer
2020-11-22 22:14:36 +01:00
parent d5e34bb71d
commit fa004876e9
8 changed files with 28 additions and 17 deletions

View File

@ -21,7 +21,12 @@ def ldap_sync_all():
@CELERY_APP.task(bind=True, base=MonitoredTask)
def ldap_sync(self: MonitoredTask, source_pk: int):
"""Synchronization of an LDAP Source"""
source: LDAPSource = LDAPSource.objects.get(pk=source_pk)
try:
source: LDAPSource = LDAPSource.objects.get(pk=source_pk)
except LDAPSource.DoesNotExist:
# Because the source couldn't be found, we don't have a UID
# to set the state with
return
self.set_uid(slugify(source.name))
try:
syncer = LDAPSynchronizer(source)