summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yaksh/templates/yaksh/quizzes_user.html11
-rw-r--r--yaksh/views.py14
2 files changed, 24 insertions, 1 deletions
diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html
index 4272ac3..cb79799 100644
--- a/yaksh/templates/yaksh/quizzes_user.html
+++ b/yaksh/templates/yaksh/quizzes_user.html
@@ -58,6 +58,17 @@
{% endif %}
{% endblock %}
<br>
+ {% if messages %}
+ {% for message in messages %}
+ <div class="alert alert-dismissible alert-{{ message.tags }}">
+ <button type="button" class="close" data-dismiss="alert">
+ <i class="fa fa-close"></i>
+ </button>
+ <strong>{{ message }}</strong>
+ </div>
+ {% endfor %}
+ {% endif %}
+ <br>
{% if msg %}
<div class="alert alert-dismissible alert-warning">
<button type="button" class="close" data-dismiss="alert">
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: