def new_ds_file_comment(web, id): is_ok, result = get_episode_if_input_is_ok(web, Episode.link == id, exists = ['author','comment','reply'], notempty = ['comment'] ) if is_ok: build_and_save_comment(web, "datenspuren/" + id, result) result = None else: return direct(web, "/datenspuren/{0}/comment".format(id), errors = [result or "Captcha wrong"]) return result or redirect("/datenspuren/" + id)
def new_ds_file_rating(web, id): is_ok, result = get_episode_if_input_is_ok(web, Episode.link == id, exists = ['score'], notempty = ['score'] ) if is_ok: episode, result = result, None try: score = int(web.input('score')) except: score = None if score is not None: if score in range(1,6): Rating(episode = episode.id, score = score).save() else: return direct(web, "/datenspuren/{0}/rate".format(id), errors = [result or "Captcha wrong"]) return result or redirect("/datenspuren/" + id)
def innerFunc(web, **kw): _get_current_user(web) if web.current_user: return func(web, **kw) else: return juno.redirect("/login")
def favicon(web): redirect("/static/favicon.ico")
def restart(web): RTorrent().restart() redirect("/")
def queue_torrent(web, filename): RTorrent().queue(filename) redirect("/")
def push_torrent(web, filename): RTorrent().push(filename) redirect("/")
def reload_torrent(web, filename): RTorrent().reload(filename) redirect("/")
def remove_torrent(web, tid): RTorrent().safe_erase_torrent(tid) redirect("/")
def resume_torrent(web, tid): RTorrent().resume(tid) redirect("/")
def pause_torrent(web, tid): RTorrent().pause(tid) redirect("/")
def verify_email_key(web): if not model.user.UserConfirmationEmail(web.input('email')).activate(web.input('key')): juno.redirect("/signup") return False return True