From 119b51d4603662cb857f9bf8ed15abfe54332232 Mon Sep 17 00:00:00 2001 From: tjgorrie Date: Tue, 11 Aug 2020 17:59:52 +0100 Subject: [PATCH] Removing some zombie-code --- functions/db_functions.py | 8 -------- single_soakdb.py | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/functions/db_functions.py b/functions/db_functions.py index 226eb1e2..c1db5810 100644 --- a/functions/db_functions.py +++ b/functions/db_functions.py @@ -407,20 +407,13 @@ def transfer_table(translate_dict, filename, model): try: with transaction.atomic(): # here we need to update instead of creating, using the row we created or grabbed at the beginning - #print(f'Updating entry for {crystal_name}') if model == models.Crystal: qset = model.objects.filter(crystal_name=crystal_name) else: qset = model.objects.filter(crystal_name=crys_obj) if(len(qset) == 1): - #print(d) - #key_to_be_deleted = 'crystal_name' - #d.pop(key_to_be_deleted) - #print(d) - #print({**d}) qset.update(**d) - #print('Ding') else: print(f'More than one entry for {crystal_name}') @@ -500,7 +493,6 @@ def pop_soakdb(database_file): # 1.5) Bump modification_date accordingly... # 2) If 1) Fails, then create the soakdb file as the existing code had it... print(f'Checking if {database_file} exists') - toupdate = {'modification_date': modification_date} try: soakdb_entry = models.SoakdbFiles.objects.get(filename=database_file) print('Exists') diff --git a/single_soakdb.py b/single_soakdb.py index 3ec732fb..88bfd416 100644 --- a/single_soakdb.py +++ b/single_soakdb.py @@ -147,8 +147,7 @@ def run_transfer(filename): # # if maint_exists == 1: soakdb_query = SoakdbFiles.objects.get(filename=filename) - print(soakdb_query) - print('adding a new entry for file...') + print('Updating/adding a new entry for file... (not deleting)') #soakdb_query.delete() # the next step is always the same