Work on Impexium, exhibit, and badge related

This commit is contained in:
Scott Idem
2022-02-23 18:34:21 -05:00
parent 5a84119c77
commit 18d8b73eb3
10 changed files with 489 additions and 346 deletions

View File

@@ -1,4 +1,3 @@
from __future__ import annotations
import datetime, hashlib, logging, os, pytz, redis, secrets
from typing import Dict, List, Optional, Set, Union
@@ -56,6 +55,12 @@ def mk_resp(
elif isinstance(data, list):
log.info('Data type is a list')
data_out = data
elif isinstance(data, int):
log.info('Data type is an int')
data_out = { 'result': data }
elif isinstance(data, str):
log.info('Data type is a str')
data_out = { 'result': data }
else: # Assuming it is still and object. This should be improved. Example model type: "<class 'app.models.account_models.Account_Base'>"
log.info('Data type is other')
data_out = data.dict(by_alias=by_alias, exclude_unset=exclude_unset)