bdd: move output format computation into response

This commit is contained in:
Sarah Hoffmann
2021-01-05 10:17:59 +01:00
parent 8a93f8ed94
commit 12ae8a4ed3
2 changed files with 9 additions and 38 deletions

View File

@@ -40,6 +40,10 @@ class GenericResponse:
""" Common base class for all API responses.
"""
def __init__(self, page, fmt, errorcode=200):
fmt = fmt.strip()
if fmt == 'jsonv2':
fmt = 'json'
self.page = page
self.format = fmt
self.errorcode = errorcode