Skip to content

Commit 86a2450

Browse files
committed
升级依赖&&修复部分bug
1 parent e627926 commit 86a2450

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

blog/views.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,16 @@ def get_context_data(self, **kwargs):
123123
parent_comments = article_comments.filter(parent_comment=None)
124124
blog_setting = get_blog_setting()
125125
paginator = Paginator(parent_comments, blog_setting.article_comment_count)
126-
page = self.request.GET.get('comment_page', 1)
126+
page = self.request.GET.get('comment_page', '1')
127+
if not page.isnumeric():
128+
page = 1
129+
else:
130+
page = int(page)
131+
if page < 1:
132+
page = 1
133+
if page > paginator.num_pages:
134+
page = paginator.num_pages
135+
127136
p_comments = paginator.page(page)
128137
next_page = p_comments.next_page_number() if p_comments.has_next() else None
129138
prev_page = p_comments.previous_page_number() if p_comments.has_previous() else None

djangoblog/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def news(*args, **kwargs):
4949
else:
5050
return value
5151
else:
52-
logger.info(
52+
logger.debug(
5353
'cache_decorator set cache:%s key:%s' %
5454
(func.__name__, key))
5555
value = func(*args, **kwargs)

requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
coverage==6.4.4
1+
coverage==6.5.0
22
bleach==5.0.1
3-
Django==4.1.1
3+
Django==4.1.2
44
django-compressor==4.1
55
django-haystack==3.2.1
66
django-ipware==4.0.2
@@ -17,7 +17,7 @@ Pillow==9.2.0
1717
Pygments==2.13.0
1818
python-logstash==0.4.8
1919
python-slugify==6.1.2
20-
pytz==2022.2.1
20+
pytz==2022.4
2121
raven==6.10.0
2222
requests==2.28.1
2323
urllib3==1.26.12

0 commit comments

Comments
 (0)