File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ def get_collection_rows(collection_name):
5252def delete_by_link_id (identification ):
5353 """Not for normal use.
5454 Probably should only be used from command line programs."""
55- database [collection_names ['people' ]].delete_one ({'link_id' : identification })
56- database [collection_names ['profiles' ]].delete_one ({'link_id' : identification })
55+ return ( database [collection_names ['people' ]].delete_one ({'link_id' : identification }),
56+ database [collection_names ['profiles' ]].delete_one ({'link_id' : identification }) )
5757
5858def get_person_dict (identification ):
5959 """Read the data for a person from the database, as a dictionary."""
Original file line number Diff line number Diff line change @@ -26,13 +26,11 @@ def main():
2626 db_config = config ['database' ]
2727 collection_names = db_config ['collections' ]
2828 database .database_init (config )
29- count = 0
3029 with open (args .deletions ) as deletions_file :
31- count += 1
3230 for del_link_id in deletions_file .readlines ():
3331 if for_real :
3432 print ("Deleting" , del_link_id )
35- database .delete_by_link_id (del_link_id )
33+ print ( "Result:" , database .delete_by_link_id (del_link_id ) )
3634 else :
3735 print ("Would delete" , del_link_id )
3836 print ("Processed" , count , "deletion records." )
You can’t perform that action at this time.
0 commit comments