replaced brl.hash_value with brl in bulk_get_or_create because it calls bulk_create afterwards and bulk_create uses objects to create VisibleBlocks whereas brl.hash_value would return a string

This commit is contained in:
Saad Waqar
2019-10-23 20:56:08 +05:00
parent 6e0914ad5d
commit 7fca58f88b

View File

@@ -232,7 +232,7 @@ class VisibleBlocks(models.Model):
only for those that aren't already created.
"""
cached_records = cls.bulk_read(user_id, course_key)
non_existent_brls = {brl.hash_value for brl in block_record_lists if brl.hash_value not in cached_records}
non_existent_brls = {brl for brl in block_record_lists if brl.hash_value not in cached_records}
cls.bulk_create(user_id, course_key, non_existent_brls)
@classmethod