added trace output and fixed a bug when saving shipcalls without times
This commit is contained in:
parent
81a45f57cf
commit
c36e913472
@ -218,6 +218,8 @@ class SQLHandler():
|
||||
|
||||
def get_times_of_shipcall(self, shipcall)->pd.DataFrame:
|
||||
df_times = self.df_dict.get('times') # -> pd.DataFrame
|
||||
if df_times is None:
|
||||
return None
|
||||
df_times = df_times.loc[df_times["shipcall_id"]==shipcall.id]
|
||||
return df_times
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import json
|
||||
import logging
|
||||
|
||||
import traceback
|
||||
import pydapper
|
||||
|
||||
from ..schemas import model
|
||||
@ -36,6 +36,7 @@ def GetShipcalls(options):
|
||||
pooledConnection.close()
|
||||
|
||||
except Exception as ex:
|
||||
logging.error(traceback.format_exc())
|
||||
logging.error(ex)
|
||||
print(ex)
|
||||
result = {}
|
||||
@ -115,6 +116,7 @@ def PostShipcalls(schemaModel):
|
||||
return json.dumps({"id" : new_id}), 201, {'Content-Type': 'application/json; charset=utf-8'}
|
||||
|
||||
except Exception as ex:
|
||||
logging.error(traceback.format_exc())
|
||||
logging.error(ex)
|
||||
print(ex)
|
||||
result = {}
|
||||
@ -199,6 +201,7 @@ def PutShipcalls(schemaModel):
|
||||
return json.dumps({"id" : schemaModel["id"]}), 200
|
||||
|
||||
except Exception as ex:
|
||||
logging.error(traceback.format_exc())
|
||||
logging.error(ex)
|
||||
print(ex)
|
||||
result = {}
|
||||
|
||||
Reference in New Issue
Block a user