diff options
author | Dan McGee <dan@archlinux.org> | 2011-10-05 17:33:54 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-10-05 17:33:54 +0200 |
commit | 81884005d8496e12f9636e872eaedff33af77e30 (patch) | |
tree | e982ec65a5c067a4f1fe321f53906ee59d5c2d26 | |
parent | 94b4a6a3a322045e16429fd6d61e8cd051b21dd1 (diff) | |
download | archweb-81884005d8496e12f9636e872eaedff33af77e30.tar.gz archweb-81884005d8496e12f9636e872eaedff33af77e30.tar.xz |
Allow developer index to work with a non-authenticated user
This is not the normal case given the decorator on the view, but during
testing and development it is sometimes useful so others don't have to
log in over a non-secure connection to check things out.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | devel/views.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/devel/views.py b/devel/views.py index 79eef31..ebae3b3 100644 --- a/devel/views.py +++ b/devel/views.py @@ -31,7 +31,12 @@ from string import ascii_letters, digits @never_cache def index(request): '''the developer dashboard''' - inner_q = PackageRelation.objects.filter(user=request.user).values('pkgbase') + if(request.user.is_authenticated()): + inner_q = PackageRelation.objects.filter(user=request.user) + else: + inner_q = PackageRelation.objects.none() + inner_q = inner_q.values('pkgbase') + flagged = Package.objects.normal().filter( flag_date__isnull=False, pkgbase__in=inner_q).order_by('pkgname') |