Esempio n. 1
0
 def setUp(self):
     self.genBorrowReq = actUtils.createBorrowRequestAction(
         Tool.objects.get(name="Hoe"),
         profUtils.getProfileFromUsername("TaikhoomAttar"))
     self.genJoinReq = actUtils.createShedRequestAction(
         Shed.objects.get(name="Taikhoom's Shed"),
         profUtils.getProfileFromUsername("TaikhoomAttar"))
Esempio n. 2
0
def join_shed(request, id):
    if request.user.is_anonymous():
        return HttpResponseRedirect('/accounts/login')
    else:
        joinerProfile = profileUtil.getProfileFromUser(request.user)
        shedObject = shedUtil.getShedFromID(id)
        ownerProfile = shedObject.owner
        actionObject = actionUtil.createShedRequestAction(shedObject, joinerProfile)
        actionManager.processActions()
        return HttpResponseRedirect('/sheds/' + id + '/request_sent')
Esempio n. 3
0
def join_shed(request, id):
    if request.user.is_anonymous():
        return HttpResponseRedirect('/accounts/login')
    else:
        joinerProfile = profileUtil.getProfileFromUser(request.user)
        shedObject = shedUtil.getShedFromID(id)
        ownerProfile = shedObject.owner
        actionObject = actionUtil.createShedRequestAction(
            shedObject, joinerProfile)
        actionManager.processActions()
        return HttpResponseRedirect('/sheds/' + id + '/request_sent')
Esempio n. 4
0
	def setUp (self):
		self.genBorrowReq = actUtils.createBorrowRequestAction (Tool.objects.get (name = "Hoe"), profUtils.getProfileFromUsername ("TaikhoomAttar"))
		self.genJoinReq = actUtils.createShedRequestAction (Shed.objects.get (name = "Taikhoom's Shed"), profUtils.getProfileFromUsername ("TaikhoomAttar"))