Skip to content

Instantly share code, notes, and snippets.

@Rhyanz46
Created October 13, 2019 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rhyanz46/b216a16b01791619a890d61e471a0728 to your computer and use it in GitHub Desktop.
Save Rhyanz46/b216a16b01791619a890d61e471a0728 to your computer and use it in GitHub Desktop.
from flask import abort
login = True
def check(func):
def cannot_access():
abort(403, "kau tidak bisa masuk gan")
def inside():
if not login:
cannot_access()
return func()
return inside
@app.route("/settings")
@check
def kata():
return kata + " " +username
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment