fixed error when 0 posts are loaded
This commit is contained in:
@@ -10,5 +10,7 @@ def index(request):
|
|||||||
|
|
||||||
if l>=1:
|
if l>=1:
|
||||||
featured_post=posts.popleft()
|
featured_post=posts.popleft()
|
||||||
|
else:
|
||||||
|
featured_post=0
|
||||||
|
|
||||||
return render(request, 'home.html',{'posts':posts, 'featured_post':featured_post})
|
return render(request, 'home.html',{'posts':posts, 'featured_post':featured_post})
|
||||||
|
|||||||
Reference in New Issue
Block a user