diff options
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -198,7 +198,8 @@ class CourseManager(Manager): qs = qs.filter(groups__in=Group.objects.get_parents(obj), **criteria).prefetch_related("rooms") elif isinstance(obj, Room): - qs = qs.filter(rooms__in=(obj,), **criteria) + qs = qs.filter(rooms=obj, **criteria).prefetch_related("rooms", + "groups") else: raise(TypeError, "obj must be a Group or a Room") |