def prepare(self): super(ContestHandler, self).prepare() self.choose_contest() if self.is_multi_contest(): self.contest_url = \ create_url_builder(self.url(self.contest.name)) else: self.contest_url = self.url # Run render_params() now, not at the beginning of the request, # because we need contest_name self.r_params = self.render_params()
def prepare(self): super(ContestHandler, self).prepare() self.choose_contest() self._ = self.locale.translate if self.is_multi_contest(): self.contest_url = \ create_url_builder(self.url(self.contest.name)) else: self.contest_url = self.url # Run render_params() now, not at the beginning of the request, # because we need contest_name self.r_params = self.render_params()
def prepare(self): self.choose_contest() if self.contest.allowed_localizations: lang_codes = filter_language_codes( list(iterkeys(self.available_translations)), self.contest.allowed_localizations) self.available_translations = dict( (k, v) for k, v in iteritems(self.available_translations) if k in lang_codes) super(ContestHandler, self).prepare() if self.is_multi_contest(): self.contest_url = \ create_url_builder(self.url(self.contest.name)) else: self.contest_url = self.url # Run render_params() now, not at the beginning of the request, # because we need contest_name self.r_params = self.render_params()