Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
added an option to sign up for grade 12
Browse files Browse the repository at this point in the history
  • Loading branch information
msinovcic committed Jan 13, 2016
1 parent 5bd99dc commit eab1cab
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion oneplus/auth_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def post():
except Course.DoesNotExist:
course = Course.objects.create(name=settings.GRADE_10_COURSE_NAME)
classs = Class.objects.create(name=settings.GRADE_10_OPEN_CLASS_NAME, course=course)
else:
elif data["grade"] == "Grade 11":
try:
classs = Class.objects.get(name=settings.GRADE_11_OPEN_CLASS_NAME)
except Class.DoesNotExist:
Expand All @@ -247,6 +247,15 @@ def post():
except Course.DoesNotExist:
course = Course.objects.create(name=settings.GRADE_11_COURSE_NAME)
classs = Class.objects.create(name=settings.GRADE_11_OPEN_CLASS_NAME, course=course)
else:
try:
classs = Class.objects.get(name=settings.GRADE_12_OPEN_CLASS_NAME)
except Class.DoesNotExist:
try:
course = Course.objects.get(name=settings.GRADE_12_COURSE_NAME)
except Course.DoesNotExist:
course = Course.objects.create(name=settings.GRADE_12_COURSE_NAME)
classs = Class.objects.create(name=settings.GRADE_12_OPEN_CLASS_NAME, course=course)

create_participant(new_learner, classs)

Expand Down

0 comments on commit eab1cab

Please sign in to comment.