core: make autosubmit_form generic template
This commit is contained in:
@ -2,8 +2,8 @@
|
||||
|
||||
from django import forms
|
||||
|
||||
from passbook.flows.models import Flow, FlowDesignation
|
||||
from passbook.admin.forms.source import SOURCE_FORM_FIELDS
|
||||
from passbook.flows.models import Flow, FlowDesignation
|
||||
from passbook.sources.saml.models import SAMLSource
|
||||
|
||||
|
||||
|
||||
@ -6,13 +6,21 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('passbook_sources_saml', '0003_auto_20200624_1957'),
|
||||
("passbook_sources_saml", "0003_auto_20200624_1957"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='samlsource',
|
||||
name='binding_type',
|
||||
field=models.CharField(choices=[('REDIRECT', 'Redirect Binding'), ('POST', 'POST Binding'), ('POST_AUTO', 'POST Binding with auto-confirmation')], default='REDIRECT', max_length=100),
|
||||
model_name="samlsource",
|
||||
name="binding_type",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("REDIRECT", "Redirect Binding"),
|
||||
("POST", "POST Binding"),
|
||||
("POST_AUTO", "POST Binding with auto-confirmation"),
|
||||
],
|
||||
default="REDIRECT",
|
||||
max_length=100,
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
@ -5,6 +5,7 @@ from django.http import Http404, HttpRequest, HttpResponse
|
||||
from django.shortcuts import get_object_or_404, redirect, render
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils.http import urlencode
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.views import View
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from signxml import InvalidSignature
|
||||
@ -64,13 +65,10 @@ class InitiateView(View):
|
||||
if source.binding_type == SAMLBindingTypes.POST_AUTO:
|
||||
return render(
|
||||
request,
|
||||
"providers/saml/autosubmit_form.html",
|
||||
"generic/autosubmit_form.html",
|
||||
{
|
||||
"application": source,
|
||||
"attrs": {
|
||||
"SAMLRequest": _request,
|
||||
"RelayState": relay_state,
|
||||
},
|
||||
"title": _("Redirecting to %(app)s..." % {"app": source.name}),
|
||||
"attrs": {"SAMLRequest": _request, "RelayState": relay_state},
|
||||
"url": source.sso_url,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user