From 9cea49ab194419ad6e69c11702ab52ea022c93f6 Mon Sep 17 00:00:00 2001 From: Aaron Kable Date: Sun, 19 Nov 2023 19:16:29 +0800 Subject: [PATCH] dont crash when no report --- authstats/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/authstats/views.py b/authstats/views.py index c112317..e4c5753 100644 --- a/authstats/views.py +++ b/authstats/views.py @@ -43,6 +43,11 @@ def react_main(request, rid, cid): @permission_required("authstats.basic_access") def react_redirect(request): # get available models - rid = Report.objects.all().first().id + rid = 0 + try: + rid = Report.objects.all().first().id + except Exception as e: + pass + cid = request.user.profile.main_character.corporation_id return redirect("authstats:report", rid=rid, cid=cid)