From 0c5aff21bc62a803768bffba3b3991c850684db5 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 5 Jun 2020 17:02:50 +0200 Subject: [PATCH] stages/identification: minor UI fixes --- passbook/stages/identification/forms.py | 4 ++++ passbook/stages/identification/models.py | 2 +- passbook/stages/password/forms.py | 17 ++++++++++------- swagger.yaml | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/passbook/stages/identification/forms.py b/passbook/stages/identification/forms.py index 882ce0f03..224e06e91 100644 --- a/passbook/stages/identification/forms.py +++ b/passbook/stages/identification/forms.py @@ -1,5 +1,6 @@ """passbook flows identification forms""" from django import forms +from django.contrib.admin.widgets import FilteredSelectMultiple from django.core.validators import validate_email from django.utils.translation import gettext_lazy as _ from structlog import get_logger @@ -19,6 +20,9 @@ class IdentificationStageForm(forms.ModelForm): fields = ["name", "user_fields", "template", "enrollment_flow", "recovery_flow"] widgets = { "name": forms.TextInput(), + "user_fields": FilteredSelectMultiple( + _("fields"), False, choices=UserFields.choices + ), } diff --git a/passbook/stages/identification/models.py b/passbook/stages/identification/models.py index 94bf0ec48..f225b40e4 100644 --- a/passbook/stages/identification/models.py +++ b/passbook/stages/identification/models.py @@ -48,7 +48,7 @@ class IdentificationStage(Stage): related_name="+", default=None, help_text=_( - "Optional enrollment flow, which is linked at the bottom of the page." + "Optional recovery flow, which is linked at the bottom of the page." ), ) diff --git a/passbook/stages/password/forms.py b/passbook/stages/password/forms.py index f9dc91421..73cc76b68 100644 --- a/passbook/stages/password/forms.py +++ b/passbook/stages/password/forms.py @@ -1,20 +1,23 @@ """passbook administration forms""" from django import forms -from django.conf import settings from django.contrib.admin.widgets import FilteredSelectMultiple from django.utils.translation import gettext_lazy as _ -from passbook.lib.utils.reflection import path_to_class from passbook.stages.password.models import PasswordStage def get_authentication_backends(): """Return all available authentication backends as tuple set""" - for backend in settings.AUTHENTICATION_BACKENDS: - klass = path_to_class(backend) - yield backend, getattr( - klass(), "name", "%s (%s)" % (klass.__name__, klass.__module__) - ) + return [ + ( + "django.contrib.auth.backends.ModelBackend", + _("passbook-internal Userdatabase"), + ), + ( + "passbook.sources.ldap.auth.LDAPBackend", + _("passbook LDAP (Only needed when User-Sync is not enabled."), + ), + ] class PasswordForm(forms.Form): diff --git a/swagger.yaml b/swagger.yaml index 31c87f5be..b74f1d544 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -5927,7 +5927,7 @@ definitions: x-nullable: true recovery_flow: title: Recovery flow - description: Optional enrollment flow, which is linked at the bottom of the + description: Optional recovery flow, which is linked at the bottom of the page. type: string format: uuid