From 6ae576604c83b6ccf3736287934330b17992f0b5 Mon Sep 17 00:00:00 2001 From: yomguy Date: Tue, 15 Jan 2013 12:11:31 +0100 Subject: [PATCH] fix periods --- teleforma/views/core.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/teleforma/views/core.py b/teleforma/views/core.py index 4cc98dca..505f4183 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -159,11 +159,11 @@ def get_periods(user): professor = user.professor.get() periods = Period.objects.all() - if settings.TELEFORMA_E_LEARNING_TYPE == 'CRFPA': + elif settings.TELEFORMA_E_LEARNING_TYPE == 'CRFPA': student = user.crfpa_student.all() if student: student = user.crfpa_student.get() - periods = student.period.all() + periods = student.period.all() elif settings.TELEFORMA_E_LEARNING_TYPE == 'AE': student = user.ae_student.all() @@ -171,6 +171,9 @@ def get_periods(user): student = user.ae_student.get() periods = student.period.all() + elif user.is_superuser or user.if_staff: + periods = student.period.all() + return periods -- 2.39.5