Exemplo n.º 1
0
 def get_community(self, request):
     if not self.community:
         try:
             community_id = request.session['community_id']
             self.community = Community.objects.get(pk=community_id)
         except:
             self.community = Community.get_default(request)
             request.session['community_id'] = self.community.pk
     else:
         return self.community
     return self.community
     """
Exemplo n.º 2
0
 def get_community(self, request):
     if not self.community:
         self.community = Community.get_default(request)
         #add as a member
         self.save()
     return self.community