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}
|
return {'header': header_file}
|
||||||
|
|
||||||
def tagcloud(request):
|
def tagcloud(request):
|
||||||
|
tagcloud = []
|
||||||
tagcloudlist = Tag.objects.annotate(ct=Count('taggit_taggeditem_items')).order_by('-ct')
|
tagcloudlist = Tag.objects.annotate(ct=Count('taggit_taggeditem_items')).order_by('-ct')
|
||||||
|
|
||||||
if (len(tagcloudlist) > 0):
|
if (len(tagcloudlist) > 0):
|
||||||
|
@ -20,8 +21,6 @@ def tagcloud(request):
|
||||||
if (tmax == tmin):
|
if (tmax == tmin):
|
||||||
tmax += 1
|
tmax += 1
|
||||||
|
|
||||||
tagcloud = []
|
|
||||||
|
|
||||||
for cloudelement in tagcloudlist:
|
for cloudelement in tagcloudlist:
|
||||||
tagcount = cloudelement.ct
|
tagcount = cloudelement.ct
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue