diff options
author | adityacp | 2020-01-29 09:56:26 +0530 |
---|---|---|
committer | adityacp | 2020-01-29 09:58:48 +0530 |
commit | 823d875863d907925e13c2e907f1a0382edf61ac (patch) | |
tree | b9b15f63a5bdfdb21122c920be9f41d19a5ae041 /yaksh/views.py | |
parent | 08cb161d03d4d07345397e57d08d3597a5926282 (diff) | |
download | online_test-823d875863d907925e13c2e907f1a0382edf61ac.tar.gz online_test-823d875863d907925e13c2e907f1a0382edf61ac.tar.bz2 online_test-823d875863d907925e13c2e907f1a0382edf61ac.zip |
Add django messages to show enrollment message for student
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 1f714e3..d12f2a2 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -999,9 +999,15 @@ def enroll_request(request, course_id): 'Unable to add enrollments for this course, please contact your ' 'instructor/administrator.' ) - return complete(request, msg, attempt_num=None, questionpaper_id=None) + messages.warning(request, msg) course.request(user) + messages.success( + request, + "Enrollment request sent for {0} by {1}".format( + course.name, course.creator.get_full_name() + ) + ) if is_moderator(user): return my_redirect('/exam/manage/courses') else: @@ -1016,6 +1022,12 @@ def self_enroll(request, course_id): if course.is_self_enroll(): was_rejected = False course.enroll(was_rejected, user) + messages.success( + request, + "Enrolled in {0} by {1}".format( + course.name, course.creator.get_full_name() + ) + ) if is_moderator(user): return my_redirect('/exam/manage/') else: |