Skip to content

Commit

Permalink
fix: compare ID instead of whole object to avoid badly cast fields (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi authored Nov 16, 2023
1 parent 882b90c commit a6fa6c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions filesmanager/filesmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,10 @@ def sync_with_course_assets(self):
- Compare the files from the course assets with the files from the directories list.
- Remove the files that are in the directory list but not in the course assets.
"""
course_assets_files = self.get_all_serialized_assets()
course_assets_ids = [asset["id"] for asset in self.get_all_serialized_assets()]
directories_files = self.get_all_files(self.directories["children"])
for file in directories_files:
if file["metadata"] not in course_assets_files:
if file["metadata"]["id"] not in course_assets_ids:
self.delete_file_from_directory(file)

def delete_file_from_directory(self, file):
Expand Down

0 comments on commit a6fa6c6

Please sign in to comment.