From 125ea1dda5bae8ed8d9def014f495c7f7e144c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Valenta?= <git@imaniti.org> Date: Thu, 13 Apr 2023 22:52:56 +0200 Subject: [PATCH] handle errors in a better way --- instagram_token/templates/instagram_token/exchange.html | 2 +- instagram_token/views.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/instagram_token/templates/instagram_token/exchange.html b/instagram_token/templates/instagram_token/exchange.html index c198374..ba5d5ea 100644 --- a/instagram_token/templates/instagram_token/exchange.html +++ b/instagram_token/templates/instagram_token/exchange.html @@ -19,7 +19,7 @@ <div class="prose max-w-none mb-8"> <p> - VĂ˝sledky nĂĹľe mĹŻĹľeš zkopĂrovat do Majáku. + VĂ˝sledky nĂĹľe mĹŻĹľeš zkopĂrovat do Majáku. <strong>Pozor, tato stránka se zobrazĂ pouze jednou!</strong> </p> </div> diff --git a/instagram_token/views.py b/instagram_token/views.py index 8cb892b..9f31e77 100644 --- a/instagram_token/views.py +++ b/instagram_token/views.py @@ -45,7 +45,9 @@ def exchange(request): } ) - exchange_request.raise_for_status() + if not exchange_request.ok: + raise HTTPExceptions.BAD_REQUEST + exchange_request = exchange_request.json() return render( -- GitLab