Created
October 13, 2019 10:56
-
-
Save Rhyanz46/b216a16b01791619a890d61e471a0728 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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