handle dates in passed data on reporting errors

json.dumps fails on date objects
This commit is contained in:
Mateusz Konieczny 2022-11-08 23:13:02 +01:00
parent e7f67cbe8f
commit 63ec84e9b2

View File

@ -90,7 +90,7 @@ def load_data_into_database(cursor, data):
print()
print(e)
print()
print(json.dumps(entry, indent = 4))
show_dictionary(entry)
raise e
def date_in_future(date):
@ -175,6 +175,10 @@ def insert_entry(cursor, e):
e["uprn"])
)
def show_dictionary(data):
for key in data.keys():
print(key, "=", data[key])
def days_since(date, now):
if(date == None):
return None