Fix the delete_file check that the collectfiles management command runs