Exemplo n.º 1
0
    def get(self):
        clean = XssCleaner()
        badge_theme = self.request.get("theme")
        clean_badge_theme = clean.strip(badge_theme)
        if badge_theme != clean_badge_theme:
            logging.info("Cleaning: %s to %s" %
                         (badge_theme, clean_badge_theme))
        badges = db.GqlQuery("SELECT * FROM Badges where theme=:1",
                             clean_badge_theme)
        badgeset = []
        for b in badges:
            item = {
                "name": b.name,
                "description": b.description,
                "alt": b.altText,
                "key": b.key().name(),
                "perm": b.permissions
            }
            badgeset.append(item)

        values = {"badgetheme": clean_badge_theme, "badges": badgeset}
        path = os.path.join(os.path.dirname(__file__),
                            'templates/badgetheme.html')
        # TODO fix this for when you hit refresh, dont go 404 on them
        self.response.out.write(template.render(path, values))
Exemplo n.º 2
0
 def post(self):
   clean = XssCleaner()
   email = self.request.get('email')    
   email = clean.strip(email)
   newemail = Email(email=email)
   newemail.put()
   ret = {"success":"true"}
   ret = json.dumps(ret) 
   self.response.out.write(ret)
Exemplo n.º 3
0
 def post(self):
   clean = XssCleaner()
   email = self.request.get('email')    
   email = clean.strip(email)
   newemail = Email(email=email)
   newemail.put()
   ret = {"success":"true"}
   ret = json.dumps(ret) 
   self.response.out.write(ret)
Exemplo n.º 4
0
  def get(self):
    clean = XssCleaner()
    badge_theme = self.request.get("theme")
    clean_badge_theme = clean.strip(badge_theme)
    if badge_theme != clean_badge_theme:
      logging.info("Cleaning: %s to %s"%(badge_theme, clean_badge_theme))
    badges = db.GqlQuery("SELECT * FROM Badges where theme=:1", 
                         clean_badge_theme)
    badgeset = []
    for b in badges:
      item = {"name": b.name, 
       "description": b.description, 
       "alt":b.altText, 
       "key":b.key().name(),
       "perm":b.permissions }
      badgeset.append(item)

    values = {"badgetheme":clean_badge_theme,
              "badges": badgeset}
    path = os.path.join(os.path.dirname(__file__), 'templates/badgetheme.html')
    # TODO fix this for when you hit refresh, dont go 404 on them
    self.response.out.write(template.render(path, values))