summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authoradityacp2020-01-29 10:01:50 +0530
committeradityacp2020-01-29 10:01:50 +0530
commit9112d95f1fa9af0137bffc6936929e4ec7e94882 (patch)
tree89342df705fa6eac324b419dbf4a3c2fad8b7d87 /yaksh/views.py
parentabebc451e9a076c96dac586932f775663f693884 (diff)
downloadonline_test-9112d95f1fa9af0137bffc6936929e4ec7e94882.tar.gz
online_test-9112d95f1fa9af0137bffc6936929e4ec7e94882.tar.bz2
online_test-9112d95f1fa9af0137bffc6936929e4ec7e94882.zip
Disallow student to enroll if ourse enrollment is closed
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py14
1 files 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: