def timelineAllowsTaskEditing(self): """Returns True/False depending on whether orgs can edit task depending on where in the program timeline we are currently in. """ if (request_data.isBefore(self.data.timeline.orgsAnnouncedOn()) \ or self.data.timeline.tasksClaimEnded()): return False return True
def canCreateTask(self): """Checks whether the currently logged in user can edit the task. """ assert access_checker.isSet(self.data.organization) assert access_checker.isSet(self.data.mentor_for) valid_org_keys = [o.key() for o in self.data.mentor_for] if self.data.organization.key() not in valid_org_keys: raise AccessViolation(DEF_NO_TASK_CREATE_PRIV % ( self.data.organization.name)) if (request_data.isBefore(self.data.timeline.orgsAnnouncedOn()) \ or self.data.timeline.tasksClaimEnded()): raise AccessViolation(access_checker.DEF_PAGE_INACTIVE)
def beforeStudentsAnnounced(self): return request_data.isBefore(self.studentsAnnouncedOn())