Skip to content

Commit

Permalink
升级依赖&&修复部分bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liangliangyy committed Oct 8, 2022
1 parent e627926 commit 86a2450
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion blog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,16 @@ def get_context_data(self, **kwargs):
parent_comments = article_comments.filter(parent_comment=None)
blog_setting = get_blog_setting()
paginator = Paginator(parent_comments, blog_setting.article_comment_count)
page = self.request.GET.get('comment_page', 1)
page = self.request.GET.get('comment_page', '1')
if not page.isnumeric():
page = 1
else:
page = int(page)
if page < 1:
page = 1
if page > paginator.num_pages:
page = paginator.num_pages

p_comments = paginator.page(page)
next_page = p_comments.next_page_number() if p_comments.has_next() else None
prev_page = p_comments.previous_page_number() if p_comments.has_previous() else None
Expand Down
2 changes: 1 addition & 1 deletion djangoblog/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def news(*args, **kwargs):
else:
return value
else:
logger.info(
logger.debug(
'cache_decorator set cache:%s key:%s' %
(func.__name__, key))
value = func(*args, **kwargs)
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
coverage==6.4.4
coverage==6.5.0
bleach==5.0.1
Django==4.1.1
Django==4.1.2
django-compressor==4.1
django-haystack==3.2.1
django-ipware==4.0.2
Expand All @@ -17,7 +17,7 @@ Pillow==9.2.0
Pygments==2.13.0
python-logstash==0.4.8
python-slugify==6.1.2
pytz==2022.2.1
pytz==2022.4
raven==6.10.0
requests==2.28.1
urllib3==1.26.12
Expand Down

0 comments on commit 86a2450

Please sign in to comment.