@contributor_removed.connect
def checkin_files_by_user(node, user):
 files = OsfStorageFileNode.find((Q('node', 'eq', node) & Q('checkout', 'eq', user)))
 for file in files:
  file.checkout = None
  file.save()

@ contributor_removed . connect def checkin_files_by_user ( node , user ) : files = OsfStorageFileNode . find ( ( Q ( 'node' , 'eq' , node ) & Q ( 'checkout' , 'eq' , user ) ) ) for file in files : file . checkout = None file . save ( )
listens to a contributor being removed to check in all of their files .