This commit is contained in:
Armin Ronacher 2010-07-23 13:03:29 +01:00
parent 8547fdeece
commit 63001a7279
9 changed files with 85 additions and 15 deletions

View file

@ -91,6 +91,11 @@ def split_lines_wrapping(text, width=74, threshold=82):
return result
def request_wants_json():
return request.accept_mimetypes \
.best_match(['application/json', 'text/html']) == 'application/json'
def requires_login(f):
@wraps(f)
def decorated_function(*args, **kwargs):