diff options
author | adityacp | 2020-01-21 11:50:10 +0530 |
---|---|---|
committer | adityacp | 2020-01-21 11:50:10 +0530 |
commit | 1a485a73245e10e4f2c49e10e376eaa8f2f2ca8c (patch) | |
tree | 74f2988ddcc1e490a8d22e65b260dd5861169adc /yaksh/views.py | |
parent | 2ba4173ae9ceb2f1eb2b24e028b2ae419a4d035c (diff) | |
download | online_test-1a485a73245e10e4f2c49e10e376eaa8f2f2ca8c.tar.gz online_test-1a485a73245e10e4f2c49e10e376eaa8f2f2ca8c.tar.bz2 online_test-1a485a73245e10e4f2c49e10e376eaa8f2f2ca8c.zip |
Add messages in clone course view
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index b9d94c5..67f09e6 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -2399,15 +2399,21 @@ def duplicate_course(request, course_id): if course.is_teacher(user) or course.is_creator(user): # Create new entries of modules, lessons/quizzes # from current course to copied course - course.create_duplicate_course(user) + duplicate_course = course.create_duplicate_course(user) + msg = dedent( + '''\ + Course duplication successful with the name {0} , please check + the courses page.'''.format(duplicate_course.name) + ) + messages.success(request, msg) else: msg = dedent( '''\ You do not have permissions to clone {0} course, please contact your instructor/administrator.'''.format(course.name) ) - return complete(request, msg, attempt_num=None, questionpaper_id=None) - return my_redirect('/exam/manage/courses/') + messages.warning(request, msg) + return my_redirect(reverse('yaksh:course_detail', args=[course_id])) @login_required |