diff options
Diffstat (limited to 'core/utils.py')
-rw-r--r-- | core/utils.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/utils.py b/core/utils.py index b2140ed..a51425c 100644 --- a/core/utils.py +++ b/core/utils.py @@ -141,7 +141,7 @@ def write_and_commit(files, message): msgdata = 'Ask a nerd to fix this.\n\n' + cp_add.stderr + '\n\n' + cp_add.stdout + '\n\nreturn code: ' + str(cp_add.returncode) raise WriteAndCommitError(f'CANNOT git on server for this file {filename}. Edits saved but not added to git.\n\n' + msgdata) else: - print("No change %s" % filepah) + print(f"No change {filepah}") cp_commit = subprocess.run([git, "commit", "-m", message], cwd=cwd, capture_output=True, text=True) cp_status = subprocess.run([git, "status"], cwd=cwd, capture_output=True, text=True) # This produces return code = 1 if it commits OK, but when the repo still needs to be pushed to origin/expoweb @@ -205,7 +205,7 @@ def save_carefully(objectType, lookupAttribs={}, nonLookupAttribs={}): except: print(" !! - FAIL in SAVE CAREFULLY ===================", objectType) print(" !! - -- objects.get_or_create()") - print(" !! - lookupAttribs:{}\n !! - nonLookupAttribs:{}".format(lookupAttribs,nonLookupAttribs)) + print(f" !! - lookupAttribs:{lookupAttribs}\n !! - nonLookupAttribs:{nonLookupAttribs}") raise if not created and not instance.new_since_parsing: for k, v in list(nonLookupAttribs.items()): #overwrite the existing attributes from the logbook text (except date and title) @@ -215,12 +215,12 @@ def save_carefully(objectType, lookupAttribs={}, nonLookupAttribs={}): except: print(" !! - SAVE CAREFULLY ===================", objectType) print(" !! - -- instance.save()") - print(" !! - lookupAttribs:{}\n !! - nonLookupAttribs:{}".format(lookupAttribs,nonLookupAttribs)) + print(f" !! - lookupAttribs:{lookupAttribs}\n !! - nonLookupAttribs:{nonLookupAttribs}") raise try: msg = str(instance) except: - msg = "FAULT getting __str__ for instance with lookupattribs: {}:".format(lookupAttribs) + msg = f"FAULT getting __str__ for instance with lookupattribs: {lookupAttribs}:" if created: logging.info(str(instance) + ' was just added to the database for the first time. \n') |