From f5d0545d45eccfc100b337cea45c5a6805deca0a Mon Sep 17 00:00:00 2001 From: adityacp Date: Sat, 28 Mar 2020 17:18:34 +0530 Subject: Change in course modules template, views - Remove redirect url from views - Allow to edit module --- yaksh/templates/yaksh/course_added_modules.html | 4 +++- yaksh/views.py | 8 ++------ 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'yaksh') diff --git a/yaksh/templates/yaksh/course_added_modules.html b/yaksh/templates/yaksh/course_added_modules.html index 7ea55e8..9055340 100644 --- a/yaksh/templates/yaksh/course_added_modules.html +++ b/yaksh/templates/yaksh/course_added_modules.html @@ -15,7 +15,9 @@ {% for module in modules %}
- {{module.name}} + +  {{module.name}} +
diff --git a/yaksh/views.py b/yaksh/views.py index e5f9bc2..9e81b2d 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -2479,9 +2479,7 @@ def edit_lesson(request, course_id=None, module_id=None, lesson_id=None): course = get_object_or_404(Course, id=course_id) if not course.is_creator(user) and not course.is_teacher(user): raise Http404('This Lesson does not belong to you') - redirect_url = reverse("yaksh:get_course_modules", args=[course_id]) - else: - redirect_url = reverse("yaksh:show_all_lessons") + context = {} if request.method == "POST": if "Save" in request.POST: @@ -2516,7 +2514,7 @@ def edit_lesson(request, course_id=None, module_id=None, lesson_id=None): return redirect( reverse("yaksh:edit_lesson", args=[course_id, module_id, lesson.id]) - ) + ) else: context['lesson_form'] = lesson_form context['error'] = lesson_form["video_file"].errors @@ -2699,12 +2697,10 @@ def add_module(request, course_id=None, module_id=None): user = request.user if not is_moderator(user): raise Http404('You are not allowed to view this page!') - redirect_url = reverse("yaksh:show_all_modules") if course_id: course = Course.objects.get(id=course_id) if not course.is_creator(user) and not course.is_teacher(user): raise Http404('This course does not belong to you') - redirect_url = reverse("yaksh:get_course_modules", args=[course_id]) if module_id: module = LearningModule.objects.get(id=module_id) if not module.creator == user and not course_id: -- cgit