def checkAccess(self): self.check.isProfileActive() id = int(self.data.kwargs['id']) self.data.invite = self.data.request_entity = Request.get_by_id(id) self.check.isRequestPresent(self.data.request_entity, id) self.data.organization = self.data.request_entity.group self.data.invited_user = self.data.requester = self.data.request_entity.user if self.data.POST: self.data.action = self.data.POST['action'] if self.data.action == self.ACTIONS['accept']: self.check.canRespondToRequest() elif self.data.action == self.ACTIONS['reject']: self.check.canRespondToRequest() elif self.data.action == self.ACTIONS['resubmit']: self.check.canResubmitRequest() # withdraw action else: self.check.canViewRequest() self.mutator.canRespondForUser() key_name = '/'.join([ self.data.program.key().name(), self.data.requester.link_id]) self.data.requester_profile = GSoCProfile.get_by_key_name( key_name, parent=self.data.requester)
def checkAccess(self): self.check.isProfileActive() id = int(self.data.kwargs['id']) self.data.invite = self.data.request_entity = Request.get_by_id(id) self.check.isRequestPresent(self.data.request_entity, id) self.data.organization = self.data.request_entity.group self.data.invited_user = self.data.requester = self.data.request_entity.user if self.data.POST: self.data.action = self.data.POST['action'] if self.data.action == self.ACTIONS['accept']: self.check.canRespondToRequest() elif self.data.action == self.ACTIONS['reject']: self.check.canRespondToRequest() elif self.data.action == self.ACTIONS['resubmit']: self.check.canResubmitRequest() # withdraw action else: self.check.canViewRequest() self.mutator.canRespondForUser() key_name = '/'.join( [self.data.program.key().name(), self.data.requester.link_id]) self.data.requester_profile = GSoCProfile.get_by_key_name( key_name, parent=self.data.requester)
def checkAccess(self): self.check.isProfileActive() invite_id = int(self.data.kwargs['id']) self.data.invite = Request.get_by_id(invite_id) self.check.isInvitePresent(invite_id) self.data.organization = self.data.invite.org self.data.invited_user = self.data.invite.user if self.data.POST: self.data.action = self.data.POST['action'] if self.data.action == self.ACTIONS['accept']: self.check.canRespondToInvite() elif self.data.action == self.ACTIONS['reject']: self.check.canRespondToInvite() elif self.data.action == self.ACTIONS['resubmit']: self.check.canResubmitInvite() else: self.check.canViewInvite() self.mutator.canRespondForUser() if self.data.user.key() == self.data.invited_user.key(): self.data.invited_profile = self.data.profile return key_name = '/'.join([ self.data.program.key().name(), self.data.invited_user.link_id]) self.data.invited_profile = GSoCProfile.get_by_key_name( key_name, parent=self.data.invited_user)
def checkAccess(self): self.check.isProfileActive() id = int(self.data.kwargs['id']) self.data.invite = Request.get_by_id(id) self.check.isRequestPresent(self.data.invite, id) self.data.organization = self.data.invite.group self.data.invited_user = self.data.invite.user if self.data.POST: self.data.action = self.data.POST['action'] if self.data.action == self.ACTIONS['accept']: self.check.canRespondToInvite() elif self.data.action == self.ACTIONS['reject']: self.check.canRespondToInvite() else: self.check.canViewInvite() self.mutator.canRespondForUser()