]> git.parisson.com Git - teleforma.git/commitdiff
Fix no courses
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 11 Oct 2016 08:25:32 +0000 (10:25 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 11 Oct 2016 08:25:32 +0000 (10:25 +0200)
teleforma/views/core.py

index 37608b5abcb5f923f53d96fffa41484f69bf1c25..a6f9965acf04a91fcecb89dd7c01ceecafd0195d 100644 (file)
@@ -136,9 +136,10 @@ def get_room(content_type=None, id=None, name=None, period=None):
 
 def get_access(obj, courses):
     access = False
-    for course in courses:
-        if obj.course == course['course']:
-            access = True
+    if courses:
+        for course in courses:
+            if obj.course == course['course']:
+                access = True
     return access
 
 access_error = _('Access not allowed.')