def get(self): session = get_current_session() try: email = session['email'] permissions_list = session['permissions_list'] except: self.redirect("/authentication?destination=/invite") return if not email and permissions_list: self.redirect("/authentication?destination=/invite") return if not any("Administrator" in s for s in permissions_list): self.redirect("/authentication?destination=/invite&message=You do not have permission to view this page, if this is in error contact us") return login_url = users.create_login_url("/invite") user = users.get_current_user() if not user: self.response.out.write("<a href='%s'>Log in via google</a>" % login_url) return data = { "message": self.request.get("message"), "permission_dict": settings.PERMISSIONS_DICT, "logged_in": check_login(), } self.response.out.write(template.render(get_template_path(TEMPLATE_URI), data))
def get(self, invite_hash): data = { "invite_hash": invite_hash, "message": self.request.get("message"), "logged_in": check_login(), } self.response.out.write(template.render(get_template_path(TEMPLATE_URI), data))
def get(self): data = { "charts_page_current": True, "message": self.request.get("message"), "logged_in": check_login(), } self.response.out.write(template.render(get_template_path(TEMPLATE_URI), data))
def get(self): destination = self.request.get("destination") data = { "destination": destination, "message": self.request.get("message"), "logged_in": check_login(), } self.response.out.write(template.render(get_template_path(TEMPLATE_URI), data))
def get(self, region): #gql_string = 'SELECT * From AgeGroup'# WHERE status >= %s", where_string #q = db.GqlQuery(gql_string) #age_groups=q.run() #gql_string = 'SELECT * From ProgramType'# WHERE status >= %s", where_string #q = db.GqlQuery(gql_string) #program_types = q.run() data = { "leaflet_map": template.render(get_template_path(LEAFLET_TEMPLATE_URL), {}), "map_page_current": True, "message": self.request.get("message"), "incident": region, #"age_groups": age_groups, #"program_types": program_types, "logged_in": check_login(), } self.response.out.write(template.render(get_template_path(TEMPLATE_URI), data))
def get(self): # show list of all locations on an HTML q = region_db.Region.all() query = q.fetch(1000) data = { "regions_list": query, } self.response.out.write(template.render(get_template_path(TEMPLATE_URI), data)) #self.redirect('/map/newyorkcity')
def get(self): #gql_string = 'SELECT * From Site'# WHERE status >= %s", where_string #q = db.GqlQuery(gql_string) #for site in q.run(): #db.delete(site.key()) data = { "contact_page_current": True, "message": self.request.get("message"), "logged_in": check_login(), } self.response.out.write(template.render(get_template_path(TEMPLATE_URI), data))
def get(self, site_id): site = program_db.Program.get_by_id(int(site_id)) program_metaphone = site.name_metaphone q = person_db.Person.all() q.filter('program_metaphone = ', program_metaphone) people = q.run() #for p in people: #raise Exception(p.name) data = { "site": site, "message": self.request.get("message"), "logged_in": check_login(), "people": people, } self.response.out.write(template.render(get_template_path(TEMPLATE_URI), data))
def get(self): #gql_string = 'SELECT * From Site'# WHERE status >= %s", where_string #q = db.GqlQuery(gql_string) #for site in q.run(): #db.delete(site.key()) data = { "show_banner": True, "home_page_current": True, "message": self.request.get("message"), "logged_in": check_login(), } q = db.Query(member_db.Member) q.filter("email =", "*****@*****.**") admin_exists = q.get() if not admin_exists: m = member_db.Member(email = "*****@*****.**", password_hash = get_hash("temporary_password"), permissions_list=["Administrator"]) m.put() session=get_current_session() session.clear() self.response.out.write(template.render(get_template_path(TEMPLATE_URI), data))
def get(self): session = get_current_session() try: email = session['email'] permissions_list = session['permissions_list'] except: self.redirect("/authentication?destination=/import") return if not email and permissions_list: self.redirect("/authentication?destination=/invite") return if not any("Import CSV" in s for s in permissions_list) and not any("Administrator" in s for s in permissions_list): self.redirect("/authentication?destination=/invite&message=You do not have permission to view this page, if this is in error contact us") return data = { "message": self.request.get("message"), "logged_in": check_login(), } self.response.out.write(template.render(get_template_path(TEMPLATE_URI), data))