sources/ldap: implement MonitoredTask

This commit is contained in:
Jens Langhammer
2020-10-16 14:17:47 +02:00
parent 482da81522
commit 4b3e0f0f96
6 changed files with 37 additions and 20 deletions

View File

@ -12,7 +12,7 @@ from passbook.core.signals import password_changed
from passbook.flows.planner import PLAN_CONTEXT_PENDING_USER
from passbook.sources.ldap.models import LDAPSource
from passbook.sources.ldap.password import LDAPPasswordChanger
from passbook.sources.ldap.tasks import sync_single
from passbook.sources.ldap.tasks import ldap_sync
from passbook.stages.prompt.signals import password_validate
@ -21,7 +21,7 @@ from passbook.stages.prompt.signals import password_validate
def sync_ldap_source_on_save(sender, instance: LDAPSource, **_):
"""Ensure that source is synced on save (if enabled)"""
if instance.enabled:
sync_single.delay(instance.pk)
ldap_sync.delay(instance.pk)
@receiver(password_validate)