Esempio n. 1
0
def all_sheds(request):
    if request.user.is_anonymous():
        return HttpResponseRedirect('/accounts/login')
    else:
        userProfile = profileUtil.getProfileFromUser(request.user)
        allSheds = shedUtil.getAllShedsAllSharezones()
        shedsInMySharezone = shedUtil.getAllShedsInSharezone(userProfile.sharezone)
        adminSheds = shedUtil.getAllShedsAdministratedBy(userProfile)
        ownedSheds = shedUtil.getAllShedsOwnedBy(userProfile)
        memberSheds = shedUtil.getAllShedsJoinedBy(userProfile)
        context = {}
        context.update(csrf(request))
        context['sheds'] = allSheds
        context['adminSheds'] = adminSheds
        context['ownedSheds'] = ownedSheds
        context['mySheds'] = memberSheds
        context.update(content.genBaseLoggedIn(request))
        return render_to_response('all_sheds.html', context)
Esempio n. 2
0
def all_sheds(request):
    if request.user.is_anonymous():
        return HttpResponseRedirect('/accounts/login')
    else:
        userProfile = profileUtil.getProfileFromUser(request.user)
        allSheds = shedUtil.getAllShedsAllSharezones()
        shedsInMySharezone = shedUtil.getAllShedsInSharezone(
            userProfile.sharezone)
        adminSheds = shedUtil.getAllShedsAdministratedBy(userProfile)
        ownedSheds = shedUtil.getAllShedsOwnedBy(userProfile)
        memberSheds = shedUtil.getAllShedsJoinedBy(userProfile)
        context = {}
        context.update(csrf(request))
        context['sheds'] = allSheds
        context['adminSheds'] = adminSheds
        context['ownedSheds'] = ownedSheds
        context['mySheds'] = memberSheds
        context.update(content.genBaseLoggedIn(request))
        return render_to_response('all_sheds.html', context)
Esempio n. 3
0
 def test_GetAllShedsAllSharezones(self):
     """
     """
     self.assertIn(self.getShed, shedUtils.getAllShedsAllSharezones())
Esempio n. 4
0
 def test_GetAllShedsAllSharezones(self):
     """
     """
     self.assertIn (self.getShed, shedUtils.getAllShedsAllSharezones())