From 459ed11b58ae7c924b8b13a758b111bad7aa4d8d Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 28 Jun 2020 15:57:40 +0100 Subject: avoiding problem in KH QMs import --- utils.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'utils.py') diff --git a/utils.py b/utils.py index 0c56b73..920fcdf 100644 --- a/utils.py +++ b/utils.py @@ -62,6 +62,10 @@ def save_carefully(objectType, lookupAttribs={}, nonLookupAttribs={}): print(" !! - -- instance.save()") print(" !! - lookupAttribs:{}\n !! - nonLookupAttribs:{}".format(lookupAttribs,nonLookupAttribs)) raise + try: + msg = str(instance) + except: + msg = "FAULT getting __str__ for instance with lookupattribs: {}:".format(lookupAttribs) if created: logging.info(str(instance) + ' was just added to the database for the first time. \n') -- cgit v1.2.3