summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 21c79f3..61bca4c 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -932,14 +932,14 @@ def add_course(request, course_id=None):
raise Http404("You are not allowed to view this course")
else:
course = None
-
if not is_moderator(user):
raise Http404('You are not allowed to view this page')
if request.method == 'POST':
form = CourseForm(request.POST, instance=course)
if form.is_valid():
new_course = form.save(commit=False)
- new_course.creator = user
+ if course_id is None:
+ new_course.creator = user
new_course.save()
return my_redirect('/exam/manage/courses')
else: