Skip to content

Commit

Permalink
packages: don't fetch rebuilderd status for non-logged in users
Browse files Browse the repository at this point in the history
The rebuilderd status is only shown for logged in users so fetching this
is unneeded.
  • Loading branch information
jelly committed Jul 20, 2024
1 parent 3d196f6 commit d01193a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/views/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ def details(request, name='', repo='', arch=''):
return empty_response()

rbstatus = None
try:
rbstatus = RebuilderdStatus.objects.get(pkg=pkg)
except RebuilderdStatus.DoesNotExist:
pass
if request.user.is_authenticated:
try:
rbstatus = RebuilderdStatus.objects.get(pkg=pkg)
except RebuilderdStatus.DoesNotExist:
pass
return render(request, 'packages/details.html', {'pkg': pkg, 'rbstatus': rbstatus,
'notreproducible': rbstatus.status == RebuilderdStatus.BAD if rbstatus else False})
except Package.DoesNotExist:
Expand Down

0 comments on commit d01193a

Please sign in to comment.