10 lines
381 B
Django/Jinja
10 lines
381 B
Django/Jinja
from authentik.outposts.models import Outpost
|
|
from authentik.core.models import Token
|
|
o = Outpost.objects.get(name='{{ authentik_ldap_outpost.name }}')
|
|
t = Token.objects.get(identifier=o.token_identifier)
|
|
if t.key != '{{ authentik_ldap_outpost.token }}':
|
|
t.key = '{{ authentik_ldap_outpost.token }}'
|
|
t.save(update_fields=['key'])
|
|
print('changed')
|
|
else:
|
|
print('ok')
|