Skip to content

Commit

Permalink
升级依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
liangliangyy committed Mar 28, 2023
1 parent d87579f commit cdc03af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions comments/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Create your views here.
from django.core.exceptions import ValidationError
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_protect
from django.views.generic.edit import FormView
Expand All @@ -20,14 +21,13 @@ def dispatch(self, *args, **kwargs):

def get(self, request, *args, **kwargs):
article_id = self.kwargs['article_id']

article = Article.objects.get(pk=article_id)
article = get_object_or_404(Article, pk=article_id)
url = article.get_absolute_url()
return HttpResponseRedirect(url + "#comments")

def form_invalid(self, form):
article_id = self.kwargs['article_id']
article = Article.objects.get(pk=article_id)
article = get_object_or_404(Article, pk=article_id)

return self.render_to_response({
'form': form,
Expand All @@ -39,7 +39,7 @@ def form_valid(self, form):
user = self.request.user

article_id = self.kwargs['article_id']
article = Article.objects.get(pk=article_id)
article = get_object_or_404(Article, pk=article_id)

if article.comment_status == 'c' or article.status == 'c':
raise ValidationError("该文章评论已关闭.")
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
coverage==7.2.1
coverage==7.2.2
bleach==6.0.0
Django==4.1.7
django-compressor==4.3.1
Expand All @@ -11,17 +11,17 @@ elasticsearch-dsl==7.4.0
gevent==22.10.2
jieba==0.42.1
jsonpickle==3.0.1
Markdown==3.4.1
Markdown==3.4.3
mysqlclient==2.1.1
Pillow==9.4.0
Pygments==2.14.0
python-logstash==0.4.8
python-slugify==8.0.1
pytz==2022.7.1
pytz==2023.2
raven==6.10.0
requests==2.28.2
urllib3==1.26.14
urllib3==1.26.15
WeRoBot==1.13.1
Whoosh==2.7.4
user-agents==2.2.0
redis==4.5.1
redis==4.5.3

0 comments on commit cdc03af

Please sign in to comment.