Files
birb-scheduler-teller/birb_scheduler_teller/utils/require_decorators.py
marcsello 2f5a4929a5
All checks were successful
continuous-integration/drone Build is passing
Renamed stuff
2021-12-10 23:08:58 +01:00

17 lines
292 B
Python

#!/usr/bin/env python3
from flask import request, abort
from functools import wraps
def json_required(f):
@wraps(f)
def call(*args, **kwargs):
if request.is_json:
return f(*args, **kwargs)
else:
abort(400, "JSON required")
return call