response presentation without promotion

This commit is contained in:
Cayo Puigdefabregas 2024-03-11 11:21:30 +01:00
parent c9933a0ab6
commit 29b3677da2
3 changed files with 85 additions and 1 deletions

View File

@ -0,0 +1,72 @@
{% load i18n static %}
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="NONE,NOARCHIVE" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Pangea">
<title>{% block title %}{% if title %}{{ title }} {% endif %}Pangea{% endblock %}</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<link rel="stylesheet" href= "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
<link href="{% static "/css/bootstrap.min.css" %}" rel="stylesheet">
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
<!-- Custom styles for this template -->
<link href="{% static "/css/dashboard.css" %}" rel="stylesheet">
</head>
<body id="body-login">
<header class="navbar navbar-dark sticky-top bg-grey flex-md-nowrap p-0 shadow" style="background-color: #712547;">
<div class="navbar-nav navbar-sub-brand">
</div>
<div class="navbar-nav">
</div>
</header>
<div class="container-fluid">
<div class="row">
<main class="col-md-12 bt-5">
<div class="jumbotron vertical-center">
<div id="login-wrapper" class="container" style="width: 430px;">
<div id="login-content" class="rounded">
<div id="login-branding">
</div><!-- /login-branding -->
<div class="mt-5">
<div class="row">
<div class="col">
{% trans 'Thank you, we are received your presentation correctly.' %}
</div>
</div>
</div><!-- /.row-fluid -->
</div>
<!--/#login-content-->
</div><!-- /#login-wrapper -->
</div><!-- /.jumbotron -->
</main>
</div>
</div>
</body>
</html>

View File

@ -13,4 +13,6 @@ urlpatterns = [
name="authorize"), name="authorize"),
path('allow_code', views.AllowCodeView.as_view(), path('allow_code', views.AllowCodeView.as_view(),
name="allow_code"), name="allow_code"),
path('received_code', views.ReceivedCodeView.as_view(),
name="received_code"),
] ]

View File

@ -235,7 +235,17 @@ class AllowCodeView(View):
promotion = self.authorization.promotions.first() promotion = self.authorization.promotions.first()
if not promotion: if not promotion:
raise Http404("Page not Found!") return redirect(reverse_lazy('oidc4vp:received_code'))
return redirect(promotion.get_url(code)) return redirect(promotion.get_url(code))
class ReceivedCodeView(View):
template_name = "received_code.html"
def get(self, request, *args, **kwargs):
self.context = {}
template = loader.get_template(
self.template_name,
).render()
return HttpResponse(template)