From acbe7781974fa66531a9cecb0dbbbc23b723899e Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Sun, 21 Jan 2024 14:27:21 +0100 Subject: [PATCH] clean --- oidc4vp/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oidc4vp/views.py b/oidc4vp/views.py index 0834541..d6eec81 100644 --- a/oidc4vp/views.py +++ b/oidc4vp/views.py @@ -171,9 +171,10 @@ class AllowCodeView(View): code=code, code_used=False ) - if not self.authorization.promotions.exists(): + + promotion = self.authorization.promotions.first() + if not promotion: raise Http404("Page not Found!") - promotion = self.authorization.promotions.all()[0] return redirect(promotion.get_url(code))