docs: remove imports

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt 2023-12-27 15:03:15 +01:00
parent f7b6261745
commit 365809ff34
No known key found for this signature in database
GPG key ID: 9C3FA22FABF1AA8D
2 changed files with 0 additions and 3 deletions

View file

@ -13,14 +13,12 @@ Depending on what kind of device you want to require the user to have:
#### WebAuthn #### WebAuthn
```python ```python
from authentik.stages.authenticator_webauthn.models import WebAuthnDevice
return WebAuthnDevice.objects.filter(user=request.context['pending_user'], confirmed=True).exists() return WebAuthnDevice.objects.filter(user=request.context['pending_user'], confirmed=True).exists()
``` ```
#### Duo #### Duo
```python ```python
from authentik.stages.authenticator_duo.models import DuoDevice
return DuoDevice.objects.filter(user=request.context['pending_user'], confirmed=True).exists() return DuoDevice.objects.filter(user=request.context['pending_user'], confirmed=True).exists()
``` ```

View file

@ -11,7 +11,6 @@ Newly created users can be created as inactive and can be assigned to a selected
Starting with authentik 2022.5, users can be added to dynamic groups. To do so, simply set `groups` in the flow plan context before this stage is run, for example Starting with authentik 2022.5, users can be added to dynamic groups. To do so, simply set `groups` in the flow plan context before this stage is run, for example
```python ```python
from authentik.core.models import Group
group, _ = Group.objects.get_or_create(name="some-group") group, _ = Group.objects.get_or_create(name="some-group")
# ["groups"] *must* be set to an array of Group objects, names alone are not enough. # ["groups"] *must* be set to an array of Group objects, names alone are not enough.
request.context["flow_plan"].context["groups"] = [group] request.context["flow_plan"].context["groups"] = [group]