Example #1
0
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)
Example #2
0
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")
Example #4
0
 def favicon(web):
     redirect("/static/favicon.ico")
Example #5
0
 def restart(web):
     RTorrent().restart()
     redirect("/")
Example #6
0
 def queue_torrent(web, filename):
     RTorrent().queue(filename)
     redirect("/")
Example #7
0
 def push_torrent(web, filename):
     RTorrent().push(filename)
     redirect("/")
Example #8
0
 def reload_torrent(web, filename):
     RTorrent().reload(filename)
     redirect("/")
Example #9
0
 def remove_torrent(web, tid):
     RTorrent().safe_erase_torrent(tid)
     redirect("/")
Example #10
0
 def resume_torrent(web, tid):
     RTorrent().resume(tid)
     redirect("/")
Example #11
0
 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