Merge pull request #644 from liangliangyy/dev

升级依赖
且听风吟 3 years ago committed by GitHub
commit 1163fe9e64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
@ -20,14 +21,13 @@ class CommentPostView(FormView):
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,
@ -39,7 +39,7 @@ class CommentPostView(FormView):
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("该文章评论已关闭.")

@ -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
@ -11,16 +11,16 @@ 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

Loading…
Cancel
Save