From 89f1668c5c84adcc58560b800482d0c09fd6c230 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 29 Nov 2023 13:22:13 +0100 Subject: [PATCH] fix response with problems in connections --- idhub/user/views.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/idhub/user/views.py b/idhub/user/views.py index 0d0cb35..0a3bfde 100644 --- a/idhub/user/views.py +++ b/idhub/user/views.py @@ -159,7 +159,15 @@ class DemandAuthorizationView(MyWallet, FormView): return kwargs def form_valid(self, form): - authorization = form.save() + try: + authorization = form.save() + except Exception: + txt = _("Problems connecting with {url}").format( + url=form.org.response_uri + ) + messages.error(self.request, txt) + return super().form_valid(form) + if authorization: return redirect(authorization) else: