def post(self): name = self.request_string("name") description = self.request_string("description") full_description = self.request_string("full_description") points = self.request_int("points", default = -1) badge_category = self.request_int("badge_category", default = -1) icon_src = self.request_string("icon_src", default="") # Create custom badge if CustomBadgeType.insert(name, description, full_description, points, badge_category, icon_src): util_badges.all_badges(bust_cache=True) util_badges.all_badges_dict(bust_cache=True) self.redirect("/badges/custom/award") return self.redirect("/badges/custom/create?failed=1")
def post(self): if not self.request_bool("start", default=False): return for badge in util_badges.all_badges(): badge_stat = models_badges.BadgeStat.get_or_insert_for(badge.name) if badge_stat and badge_stat.needs_update(): badge_stat.update() badge_stat.put()