Пример #1
0
def genJustRegistered(account, profile):
	results = genSuper()
	results['username'] = account.username
	results['first_name'] = account.first_name
	results['last_name'] = account.last_name
	results['picture'] = None
	results['topSheds'] = None
	sheds = shedUtil.getAllShedsJoinedBy(profile)
	sharezone = profileUtil.getSharezone(profile)
	sharezoneMembers = profileUtil.getAllProfilesInSharezone(sharezone)
	#not done
	results['tools'] = None
	results['sheds'] = sheds
	results['borrowed'] = None
	results['sharezone'] = sharezone
	results['sharezoneMembers'] = sharezoneMembers
	return addGoodRegisterNoti(results)
Пример #2
0
def genJustRegistered(account, profile):
    results = genSuper()
    results['username'] = account.username
    results['first_name'] = account.first_name
    results['last_name'] = account.last_name
    results['picture'] = None
    results['topSheds'] = None
    sheds = shedUtil.getAllShedsJoinedBy(profile)
    sharezone = profileUtil.getSharezone(profile)
    sharezoneMembers = profileUtil.getAllProfilesInSharezone(sharezone)
    #not done
    results['tools'] = None
    results['sheds'] = sheds
    results['borrowed'] = None
    results['sharezone'] = sharezone
    results['sharezoneMembers'] = sharezoneMembers
    return addGoodRegisterNoti(results)
Пример #3
0
def view_community_page(request, sharezone):
    if request.user.is_anonymous():
        return HttpResponseRedirect("/accounts/login")
    else:
        if sharezone is not None:
            sheds = shedUtil.getAllShedsInSharezone(sharezone)
            users = profileUtil.getAllProfilesInSharezone(sharezone)
            context = {}
            context['sharezone'] = sharezone
            context['sheds'] = sheds
            context['users'] = users
            context.update(content.genBaseLoggedIn(request))
            return render_to_response('community_page.html', context)
        else:
            context = {}
            context['object'] = 'community'
            context.update(content.genBaseLoggedIn(request))
            return render_to_response('dne.html', context)
Пример #4
0
def view_community_page(request, sharezone):
    if request.user.is_anonymous():
        return HttpResponseRedirect("/accounts/login")
    else:
        if sharezone is not None:
            sheds = shedUtil.getAllShedsInSharezone(sharezone)
            users = profileUtil.getAllProfilesInSharezone(sharezone)
            context = {}
            context['sharezone'] = sharezone
            context['sheds'] = sheds
            context['users'] = users
            context.update(content.genBaseLoggedIn(request))
            return render_to_response('community_page.html', context)
        else:
            context = {}
            context['object'] = 'community'
            context.update(content.genBaseLoggedIn(request))
            return render_to_response('dne.html', context)
Пример #5
0
def genUserHome(request):
    results = genBaseLoggedIn(request)
    profile = profileUtil.getProfileFromUser(request.user)
    tools = toolUtil.getAllToolsOwnedBy(profile)
    sheds = shedUtil.getAllShedsJoinedBy(profile)
    #sheds = None
    borrowedTools = toolUtil.getAllToolsBorrowedBy(profile)
    #borrowedTools = None
    #print(profile)
    #results['notif'] = notifUtil.getAllActiveProfileNotifs(profile)
    sharezone = profileUtil.getSharezone(profile)
    sharezoneMembers = profileUtil.getAllProfilesInSharezone(sharezone)
    #not done
    results['tools'] = tools
    results['sheds'] = sheds
    results['borrowed'] = borrowedTools
    results['sharezone'] = sharezone
    results['sharezoneMembers'] = sharezoneMembers
    return results
Пример #6
0
def genUserHome(request):
	results = genBaseLoggedIn(request)
	profile = profileUtil.getProfileFromUser(request.user)
	tools = toolUtil.getAllToolsOwnedBy(profile)
	sheds = shedUtil.getAllShedsJoinedBy(profile)
	#sheds = None
	borrowedTools = toolUtil.getAllToolsBorrowedBy(profile)
	#borrowedTools = None
	#print(profile)
	#results['notif'] = notifUtil.getAllActiveProfileNotifs(profile)
	sharezone = profileUtil.getSharezone(profile)
	sharezoneMembers = profileUtil.getAllProfilesInSharezone(sharezone)
	#not done
	results['tools'] = tools
	results['sheds'] = sheds
	results['borrowed'] = borrowedTools
	results['sharezone'] = sharezone
	results['sharezoneMembers'] = sharezoneMembers
	return results
Пример #7
0
 def test_GetAllProfilesInShareZone(self):
     """
     """
     self.assertIn(self.getProfile, profUtils.getAllProfilesInSharezone("Jedi Temple"))
Пример #8
0
 def test_GetAllProfilesInShareZone(self):
     """
     """
     self.assertIn(self.getProfile,
                   profUtils.getAllProfilesInSharezone("Jedi Temple"))