]> git.parisson.com Git - teleforma.git/commitdiff
fix periods
authoryomguy <yomguy@parisson.com>
Tue, 15 Jan 2013 11:11:31 +0000 (12:11 +0100)
committeryomguy <yomguy@parisson.com>
Tue, 15 Jan 2013 11:11:31 +0000 (12:11 +0100)
teleforma/views/core.py

index 4cc98dca0b63dce512c57d2fcf39ea27599e9f60..505f4183feb87d4618f8d3d8ae4ae9043edca832 100644 (file)
@@ -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