More API
This commit is contained in:
parent
8547fdeece
commit
63001a7279
9 changed files with 85 additions and 15 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue