fdsfsd
This commit is contained in:
parent
629b00eb0d
commit
0dcfc4d943
12 changed files with 93 additions and 93 deletions
|
@ -21,7 +21,7 @@ beams_client = PushNotifications(
|
|||
|
||||
|
||||
@app.post("/pay_rent")
|
||||
@limiter.limit("1/0.5second")
|
||||
@limiter.limit("1/second")
|
||||
@auth_required
|
||||
def pay_rent(v):
|
||||
if v.coins < 500: return "You must have more than 500 coins."
|
||||
|
@ -37,7 +37,7 @@ def pay_rent(v):
|
|||
|
||||
|
||||
@app.post("/steal")
|
||||
@limiter.limit("1/0.5second")
|
||||
@limiter.limit("1/second")
|
||||
@is_not_banned
|
||||
def steal(v):
|
||||
if int(time.time()) - v.created_utc < 604800:
|
||||
|
@ -91,7 +91,7 @@ def thiefs(v):
|
|||
|
||||
|
||||
@app.post("/@<username>/suicide")
|
||||
@limiter.limit("1/0.5second")
|
||||
@limiter.limit("1/second")
|
||||
@auth_required
|
||||
def suicide(v, username):
|
||||
t = int(time.time())
|
||||
|
@ -113,7 +113,7 @@ def get_coins(v, username):
|
|||
else: return {"error": "invalid_user"}, 404
|
||||
|
||||
@app.post("/@<username>/transfer_coins")
|
||||
@limiter.limit("1/0.5second")
|
||||
@limiter.limit("1/second")
|
||||
@is_not_banned
|
||||
@validate_formkey
|
||||
def transfer_coins(v, username):
|
||||
|
@ -202,7 +202,7 @@ def song(song):
|
|||
return resp
|
||||
|
||||
@app.post("/subscribe/<post_id>")
|
||||
@limiter.limit("1/0.5second")
|
||||
@limiter.limit("1/second")
|
||||
@auth_required
|
||||
def subscribe(v, post_id):
|
||||
new_sub = Subscription(user_id=v.id, submission_id=post_id)
|
||||
|
@ -211,7 +211,7 @@ def subscribe(v, post_id):
|
|||
return {"message": "Post subscribed!"}
|
||||
|
||||
@app.post("/unsubscribe/<post_id>")
|
||||
@limiter.limit("1/0.5second")
|
||||
@limiter.limit("1/second")
|
||||
@auth_required
|
||||
def unsubscribe(v, post_id):
|
||||
sub=g.db.query(Subscription).options(lazyload('*')).filter_by(user_id=v.id, submission_id=post_id).first()
|
||||
|
@ -221,7 +221,7 @@ def unsubscribe(v, post_id):
|
|||
return {"message": "Post unsubscribed!"}
|
||||
|
||||
@app.post("/@<username>/message")
|
||||
@limiter.limit("1/0.5second")
|
||||
@limiter.limit("1/second")
|
||||
@limiter.limit("10/hour")
|
||||
@auth_required
|
||||
def message2(v, username):
|
||||
|
@ -284,7 +284,7 @@ def message2(v, username):
|
|||
|
||||
|
||||
@app.post("/reply")
|
||||
@limiter.limit("1/0.5second")
|
||||
@limiter.limit("1/second")
|
||||
@limiter.limit("6/minute")
|
||||
@auth_required
|
||||
def messagereply(v):
|
||||
|
@ -616,7 +616,7 @@ def u_username_info(username, v=None):
|
|||
|
||||
|
||||
@app.post("/follow/<username>")
|
||||
@limiter.limit("1/0.5second")
|
||||
@limiter.limit("1/second")
|
||||
@auth_required
|
||||
def follow_user(username, v):
|
||||
|
||||
|
@ -642,7 +642,7 @@ def follow_user(username, v):
|
|||
return {"message": "User followed!"}
|
||||
|
||||
@app.post("/unfollow/<username>")
|
||||
@limiter.limit("1/0.5second")
|
||||
@limiter.limit("1/second")
|
||||
@auth_required
|
||||
def unfollow_user(username, v):
|
||||
|
||||
|
@ -669,7 +669,7 @@ def unfollow_user(username, v):
|
|||
return {"message": "User unfollowed!"}
|
||||
|
||||
@app.post("/remove_follow/<username>")
|
||||
@limiter.limit("1/0.5second")
|
||||
@limiter.limit("1/second")
|
||||
@auth_required
|
||||
def remove_follow(username, v):
|
||||
target = get_user(username)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue