Fix tag cloud generating code
It now works even if there are no tags.
This commit is contained in:
parent
4f8db2dc97
commit
8820dd89ba
@ -11,6 +11,7 @@ def randomheader(request):
|
||||
return {'header': header_file}
|
||||
|
||||
def tagcloud(request):
|
||||
tagcloud = []
|
||||
tagcloudlist = Tag.objects.annotate(ct=Count('taggit_taggeditem_items')).order_by('-ct')
|
||||
|
||||
if (len(tagcloudlist) > 0):
|
||||
@ -20,8 +21,6 @@ def tagcloud(request):
|
||||
if (tmax == tmin):
|
||||
tmax += 1
|
||||
|
||||
tagcloud = []
|
||||
|
||||
for cloudelement in tagcloudlist:
|
||||
tagcount = cloudelement.ct
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user