You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
682 B
25 lines
682 B
from django.http import Http404
|
|
from lms.decors import response_decor
|
|
from management.models import Comment
|
|
|
|
|
|
@response_decor(template='comment_one.html', without_auth=False)
|
|
def comment_view(request, view_id):
|
|
# Страница вопроса форума
|
|
try:
|
|
comment = Comment.objects.get(token=view_id)
|
|
except Comment.DoesNotExist:
|
|
raise Http404
|
|
else:
|
|
if comment.status in ['S', 'Q'] or request.user.is_admin:
|
|
comment = comment.get_face()
|
|
else:
|
|
raise Http404
|
|
|
|
return {'comment': comment}
|
|
|
|
|
|
@response_decor(template='forum.html', without_auth=False)
|
|
def index(request):
|
|
raise Http404
|
|
return {}
|
|
|