diff options
author | adityacp | 2020-03-28 17:18:34 +0530 |
---|---|---|
committer | adityacp | 2020-03-28 17:18:34 +0530 |
commit | f5d0545d45eccfc100b337cea45c5a6805deca0a (patch) | |
tree | ea21e0f77be67894d38171925d0809109da627e7 /yaksh/views.py | |
parent | b835440b1e2ca0059e95b6848cb87cc5724ee967 (diff) | |
download | online_test-f5d0545d45eccfc100b337cea45c5a6805deca0a.tar.gz online_test-f5d0545d45eccfc100b337cea45c5a6805deca0a.tar.bz2 online_test-f5d0545d45eccfc100b337cea45c5a6805deca0a.zip |
Change in course modules template, views
- Remove redirect url from views
- Allow to edit module
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 8 |
1 files changed, 2 insertions, 6 deletions
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: |