From 671eaf98c8bfe38db19867e29e5047973099b1cf Mon Sep 17 00:00:00 2001 From: adityacp Date: Fri, 16 Sep 2016 19:24:52 +0530 Subject: changed fixtures and views --- yaksh/management/commands/create_demo_course.py | 10 +++++----- yaksh/views.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'yaksh') diff --git a/yaksh/management/commands/create_demo_course.py b/yaksh/management/commands/create_demo_course.py index 9cb6058..ef3cb6b 100644 --- a/yaksh/management/commands/create_demo_course.py +++ b/yaksh/management/commands/create_demo_course.py @@ -16,7 +16,7 @@ def create_demo_course(): success = False print("Creating Demo User...") # create a demo user - user, u_status = User.objects.get_or_create(username='demo_user', + user, u_status = User.objects.get_or_create(username='yaksh_demo_user', email='demo@test.com') user.set_password("demo") user.save() @@ -24,12 +24,12 @@ def create_demo_course(): institute='demo_institute', department='demo_department', position='Faculty') - demo_user = User.objects.filter(username='demo_user') + demo_user = User.objects.filter(username='yaksh_demo_user') add_to_group(demo_user) print("Creating Demo Course...") # create a demo course - course, c_status = Course.objects.get_or_create(name="Demo_course", + course, c_status = Course.objects.get_or_create(name="Yaksh_Demo_course", enrollment="open", creator=user) @@ -42,14 +42,14 @@ def create_demo_course(): duration=30, active=True, attempts_allowed=-1, time_between_attempts=0, - description='Demo_quiz', pass_criteria=0, + description='Yaksh_Demo_quiz', pass_criteria=0, language='Python', prerequisite=None, course=course) else: print("Demo Quiz Already Created") print("Creating Demo Questions...") - questions = Question.objects.filter(active=True, summary="Demo Question") + questions = Question.objects.filter(active=True, summary="Yaksh Demo Question") files = FileUpload.objects.filter(question__in=questions) if not files: #create demo question diff --git a/yaksh/views.py b/yaksh/views.py index a9e17ab..95e4b7d 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -669,7 +669,7 @@ def courses(request): if not is_moderator(user): raise Http404('You are not allowed to view this page') try: - demo_user = User.objects.get(username="demo_user") + demo_user = User.objects.get(username="yaksh_demo_user") except User.DoesNotExist: demo_user = None courses = Course.objects.filter(Q(creator=user) | Q(creator=demo_user), -- cgit