]> git.parisson.com Git - telemeta.git/commitdiff
fix searches when anon
authoryomguy <yomguy@parisson.com>
Tue, 1 May 2012 19:30:02 +0000 (21:30 +0200)
committeryomguy <yomguy@parisson.com>
Tue, 1 May 2012 19:30:02 +0000 (21:30 +0200)
telemeta/views/base.py

index 59cb9456a8f7841b8fcf527c2b4365d3045c4cb9..3f8a743e13834a135604c0b461941d59d3f46024 100644 (file)
@@ -256,7 +256,10 @@ class GeneralView(object):
         rec_years = year_min and year_max and range(year_min, year_max + 1) or []
         year_min, year_max = MediaCollection.objects.all().publishing_year_range()
         pub_years = year_min and year_max and range(year_min, year_max + 1) or []
-        searches = Search.objects.filter(username=request.user)
+        if request.user:
+            searches = Search.objects.filter(username=request.user)
+        else:
+            searches = []
         return render(request, 'telemeta/search_criteria.html', {
             'rec_years': rec_years,
             'pub_years': pub_years,