Skip to content

Commit

Permalink
fix: avoid crash on non-existing backend
Browse files Browse the repository at this point in the history
Fixes WEBSITE-1X
  • Loading branch information
nijel committed Nov 3, 2024
1 parent 2a7f3a2 commit 376426b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion weblate_web/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,10 @@ def dispatch(self, request, *args, **kwargs):
return redirect("payment", pk=self.object.pk)

# Get backend and refetch payment from the database
backend = get_backend(self.object.backend)(self.object)
try:
backend = get_backend(self.object.backend)(self.object)
except KeyError as error:
raise Http404("Non-existing backend") from error

# Allow reprocessing of rejected payments. User might choose
# to retry in the payment gateway and previously rejected payment
Expand Down

0 comments on commit 376426b

Please sign in to comment.