Example #1
0
    def _getAddNewOrgAppLink(self):
        """Get the link for org admins to take organization application survey.
    """
        survey = org_app_logic.getForProgram(self.data.program)
        if not survey or not self.data.timeline.surveyPeriod(survey):
            return []

        r = self.data.redirect
        r.program()

        return {
            "name": "take_org_app",
            "description": ugettext("Take organization application survey."),
            "title": "Take organization application",
            "link": r.urlOf("gci_take_org_app"),
        }
Example #2
0
    def _getMyOrgApplicationsComponent(self):
        """Returns MyOrgApplicationsComponent iff this user is main_admin or
    backup_admin in an application.
    """
        survey = org_app_logic.getForProgram(self.data.program)

        # Test if this user is main admin or backup admin
        q = OrgAppRecord.all()
        q.filter("survey", survey)
        q.filter("main_admin", self.data.user)

        record = q.get()

        q = OrgAppRecord.all()
        q.filter("survey", survey)
        q.filter("backup_admin", self.data.user)

        if record or q.get():
            # add a component showing the organization application of the user
            return MyOrgApplicationsComponent(self.request, self.data, survey)

        return None