Don't fail if AppSession is not set

This commit is contained in:
Kumi 2023-07-08 16:42:29 +02:00
parent dbf42a0365
commit 9f20d23a07
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -23,7 +23,7 @@ class ReverifyView(TitleMixin, LoginView):
app_session = AppSession.objects.get(id=self.request.session["AppSession"])
app_session.used = True
app_session.save()
except AppSession.DoesNotExist:
except (AppSession.DoesNotExist, KeyError):
pass
return HttpResponseRedirect(self.get_success_url())