Fix a bug : take last posts and not first if there is no new posts with the current year
This commit is contained in:
parent
224faf5dc4
commit
bf86e7a81b
|
@ -359,7 +359,7 @@ class Index(DynastieGenerator):
|
||||||
posts = Post.objects.filter(creation_date__year=cur_year, published=True, front_page=True).order_by('-creation_date')
|
posts = Post.objects.filter(creation_date__year=cur_year, published=True, front_page=True).order_by('-creation_date')
|
||||||
|
|
||||||
if posts.count() < self.posts_per_page:
|
if posts.count() < self.posts_per_page:
|
||||||
posts = Post.objects.all()[:self.posts_per_page]
|
posts = Post.objects.all().order_by('-creation_date')[:self.posts_per_page]
|
||||||
|
|
||||||
self.dirname = ''
|
self.dirname = ''
|
||||||
self.generatePages(dom, posts, src, output, 'index')
|
self.generatePages(dom, posts, src, output, 'index')
|
||||||
|
|
2
wsgi.py
2
wsgi.py
|
@ -18,7 +18,7 @@ import sys
|
||||||
|
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dynastie.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dynastie.settings")
|
||||||
|
|
||||||
dynastie_root = '/home/soutade/Projets_Perso/dynastie2/dynastie/'
|
dynastie_root = '/home/soutade/dynastie/'
|
||||||
if dynastie_root not in sys.path:
|
if dynastie_root not in sys.path:
|
||||||
sys.path.append(dynastie_root)
|
sys.path.append(dynastie_root)
|
||||||
dynastie_root += 'dynastie/'
|
dynastie_root += 'dynastie/'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user