from django.db import models
from django.db.models import Q

class ForumManager(models.Manager):
    def for_groups(self, groups):
        if groups:
            public = Q(groups__isnull=True)
            user_groups = Q(groups__in=groups)
            return self.filter(public|user_groups)
        return self.filter(groups__isnull=True)
    
    def has_access(self, forum, groups):
        return forum in self.for_groups(groups)

@@ -280,24 +280,35 @@
 user_groups)
+.distinct()
 %0A        ret

Fix issue #74 - if a forum can be accessed by multiple groups, and a user is in those multiple groups, forums were being listed twice. Thanks to Jamie Curle for the patch