Commit fb18c1bc by Őry Máté

school: do not automatically create attended courses

fixes #33
parent 859cabd7
...@@ -55,9 +55,10 @@ def login(request): ...@@ -55,9 +55,10 @@ def login(request):
else: else:
attended = attended.split(';') attended = attended.split(';')
for c in attended: for c in attended:
co, created = Course.objects.get_or_create(code=c) try:
if created: co = Course.objects.get(code=c)
logger.warning("django Course %s created" % c) except:
continue
g = co.get_or_create_default_group() g = co.get_or_create_default_group()
if p.course_groups.filter(semester=sem, course=co).count() == 0: if p.course_groups.filter(semester=sem, course=co).count() == 0:
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment