Kenneth Bruen
3 years ago
3 changed files with 26 additions and 1 deletions
@ -0,0 +1,12 @@ |
|||||||
|
from http import HTTPStatus |
||||||
|
from functools import wraps |
||||||
|
|
||||||
|
def no_content(fn): |
||||||
|
@wraps(fn) |
||||||
|
def wrapper(*args, **kargs): |
||||||
|
result = fn(*args, **kargs) |
||||||
|
if result is None: |
||||||
|
return None, HTTPStatus.NO_CONTENT |
||||||
|
else: |
||||||
|
return result |
||||||
|
return wrapper |
Loading…
Reference in new issue