Skip to content

Commit

Permalink
Removing some zombie-code
Browse files Browse the repository at this point in the history
  • Loading branch information
tjgorrie committed Aug 11, 2020
1 parent 66ec306 commit 119b51d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
8 changes: 0 additions & 8 deletions functions/db_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')

Expand Down Expand Up @@ -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')
Expand Down
3 changes: 1 addition & 2 deletions single_soakdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 119b51d

Please sign in to comment.