summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorCruiseDevice2020-10-01 14:17:56 +0530
committerankitjavalkar2020-10-08 10:42:51 +0530
commitedf3b4c5d9afdaeb7c6d8e45484401bdce26e23c (patch)
treed8454d5a418da7309a9714f6389efe7bef2930f8 /yaksh/views.py
parent86a8e2d43294eadf164710589c70bf497f65d801 (diff)
downloadonline_test-edf3b4c5d9afdaeb7c6d8e45484401bdce26e23c.tar.gz
online_test-edf3b4c5d9afdaeb7c6d8e45484401bdce26e23c.tar.bz2
online_test-edf3b4c5d9afdaeb7c6d8e45484401bdce26e23c.zip
User can create anonymous post and comment
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 8c9a9e4..69a7414 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -2824,6 +2824,7 @@ def show_lesson(request, lesson_id, module_id, course_id):
new_comment = form.save(commit=False)
new_comment.creator = request.user
new_comment.post_field = post
+ new_comment.anonymous = request.POST.get('anonymous', '') == 'on'
new_comment.save()
return redirect(request.path_info)
else:
@@ -3500,6 +3501,7 @@ def course_forum(request, course_id):
new_post = form.save(commit=False)
new_post.creator = user
new_post.target = course
+ new_post.anonymous = request.POST.get('anonymous', '') == 'on'
new_post.save()
return redirect('yaksh:post_comments',
course_id=course.id, uuid=new_post.uid)
@@ -3557,6 +3559,7 @@ def post_comments(request, course_id, uuid):
new_comment = form.save(commit=False)
new_comment.creator = request.user
new_comment.post_field = post
+ new_comment.anonymous = request.POST.get('anonymous', '') == 'on'
new_comment.save()
return redirect(request.path_info)
return render(request, 'yaksh/post_comments.html', {