From e138076e1d68760bf07ef2f7af66a718d649e5c1 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 16 Feb 2020 12:34:46 +0100 Subject: [PATCH] sources/saml: move labels from forms to models --- passbook/sources/saml/forms.py | 5 ----- passbook/sources/saml/models.py | 10 ++++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/passbook/sources/saml/forms.py b/passbook/sources/saml/forms.py index 3039da775..14e350e78 100644 --- a/passbook/sources/saml/forms.py +++ b/passbook/sources/saml/forms.py @@ -28,11 +28,6 @@ class SAMLSourceForm(forms.ModelForm): "auto_logout", "signing_cert", ] - labels = { - "entity_id": "Entity ID", - "idp_url": "IDP URL", - "idp_logout_url": "IDP Logout URL", - } widgets = { "name": forms.TextInput(), "policies": FilteredSelectMultiple(_("policies"), False), diff --git a/passbook/sources/saml/models.py b/passbook/sources/saml/models.py index c28474935..ae4cb6c6b 100644 --- a/passbook/sources/saml/models.py +++ b/passbook/sources/saml/models.py @@ -1,7 +1,7 @@ """saml sp models""" from django.db import models from django.urls import reverse_lazy -from django.utils.translation import gettext as _ +from django.utils.translation import gettext_lazy as _ from passbook.core.models import Source @@ -9,9 +9,11 @@ from passbook.core.models import Source class SAMLSource(Source): """SAML2 Source""" - entity_id = models.TextField(blank=True, default=None) - idp_url = models.URLField() - idp_logout_url = models.URLField(default=None, blank=True, null=True) + entity_id = models.TextField(blank=True, default=None, verbose_name=_("Entity ID")) + idp_url = models.URLField(verbose_name=_("IDP URL")) + idp_logout_url = models.URLField( + default=None, blank=True, null=True, verbose_name=_("IDP Logout URL") + ) auto_logout = models.BooleanField(default=False) signing_cert = models.TextField()