From 9112d95f1fa9af0137bffc6936929e4ec7e94882 Mon Sep 17 00:00:00 2001 From: adityacp Date: Wed, 29 Jan 2020 10:01:50 +0530 Subject: Disallow student to enroll if ourse enrollment is closed --- yaksh/views.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/yaksh/views.py b/yaksh/views.py index d12f2a2..acd5c62 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -1000,14 +1000,14 @@ def enroll_request(request, course_id): 'instructor/administrator.' ) 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() + else: + 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: -- cgit