diff --git a/authentik/sources/ldap/api.py b/authentik/sources/ldap/api.py index 88b041855..abe9e8c82 100644 --- a/authentik/sources/ldap/api.py +++ b/authentik/sources/ldap/api.py @@ -64,8 +64,9 @@ class LDAPSourceViewSet(ModelViewSet): @swagger_auto_schema(responses={200: LDAPSourceSyncStatusSerializer(many=False)}) @action(methods=["GET"], detail=True) - # pylint: disable=invalid-name + # pylint: disable=unused-argument def sync_status(self, request: Request, slug: str) -> Response: + """Get source's sync status""" source = self.get_object() last_sync = cache.get(source.state_cache_prefix("last_sync"), None) return Response( diff --git a/authentik/sources/ldap/models.py b/authentik/sources/ldap/models.py index 94dffecf3..9d74eb73d 100644 --- a/authentik/sources/ldap/models.py +++ b/authentik/sources/ldap/models.py @@ -1,8 +1,6 @@ """authentik LDAP Models""" -from datetime import datetime from typing import Optional, Type -from django.core.cache import cache from django.db import models from django.forms import ModelForm from django.utils.translation import gettext_lazy as _ @@ -11,7 +9,6 @@ from rest_framework.serializers import Serializer from authentik.core.models import Group, PropertyMapping, Source from authentik.lib.models import DomainlessURLValidator -from authentik.lib.utils.template import render_to_string class LDAPSource(Source): diff --git a/web/src/elements/buttons/ActionButton.ts b/web/src/elements/buttons/ActionButton.ts index 12a6047c1..b28a047be 100644 --- a/web/src/elements/buttons/ActionButton.ts +++ b/web/src/elements/buttons/ActionButton.ts @@ -9,6 +9,9 @@ export class ActionButton extends SpinnerButton { @property() url = ""; + @property() + method = "POST"; + callAction(): void { if (this.isRunning === true) { return; @@ -19,7 +22,7 @@ export class ActionButton extends SpinnerButton { headers: { "X-CSRFToken": csrftoken }, }); fetch(request, { - method: "POST", + method: this.method, mode: "same-origin", }) .then((r) => {