sources/saml: move labels from forms to models

This commit is contained in:
Jens Langhammer 2020-02-16 12:34:46 +01:00
parent 721d133dc3
commit e138076e1d
2 changed files with 6 additions and 9 deletions

View file

@ -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),

View file

@ -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()