fix response with problems in connections

This commit is contained in:
Cayo Puigdefabregas 2023-11-29 13:22:13 +01:00
parent 4f1a5afea7
commit 89f1668c5c
1 changed files with 9 additions and 1 deletions

View File

@ -159,7 +159,15 @@ class DemandAuthorizationView(MyWallet, FormView):
return kwargs return kwargs
def form_valid(self, form): def form_valid(self, form):
try:
authorization = form.save() 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: if authorization:
return redirect(authorization) return redirect(authorization)
else: else: