Commit 9cb7f264 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

bugs

parent 5ab3235a
...@@ -22,7 +22,7 @@ class CatalogApi(object): ...@@ -22,7 +22,7 @@ class CatalogApi(object):
resp = json.loads(html) resp = json.loads(html)
if resp["code"] == 0: if resp["code"] == 0:
return Result.ok_data(data=from_dict_list(Gaia3Record, resp["data"])).append("totalCount", resp["object"]["totalCount"]) return Result.ok_data(data=from_dict_list(Gaia3Record, [] if resp["data"] == None else resp["data"])).append("totalCount", resp["object"]["totalCount"])
else: else:
return Result.error(message = resp['message']) return Result.error(message = resp['message'])
......
...@@ -165,7 +165,8 @@ class ObservationApi(object): ...@@ -165,7 +165,8 @@ class ObservationApi(object):
try: try:
if obs_id == 0: if obs_id == 0:
r = self.db.select_one("select max(id) as max_id from t_observation") r = self.db.select_one("select max(id) as max_id from t_observation")
obs_id = r["max_id"]+1 max_id = 0 if r["max_id"] is None else r["max_id"]
obs_id = max_id + 1
existed = self.db.exists( existed = self.db.exists(
"select * from t_observation where id=?", "select * from t_observation where id=?",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment