From 7fca58f88bf5ed4ce06cf4111255f3d43241d795 Mon Sep 17 00:00:00 2001 From: Saad Waqar Date: Wed, 23 Oct 2019 20:56:08 +0500 Subject: [PATCH] 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 --- lms/djangoapps/grades/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/djangoapps/grades/models.py b/lms/djangoapps/grades/models.py index c6cb91b1d8..6eb1d524f6 100644 --- a/lms/djangoapps/grades/models.py +++ b/lms/djangoapps/grades/models.py @@ -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