From 9807de4a95f3b48c4f9b6201ade5d3e75ecc1c87 Mon Sep 17 00:00:00 2001 From: Andy Shultz <ashultz@edx.org> Date: Mon, 28 Nov 2022 16:08:51 -0500 Subject: [PATCH] fix: do not attempt to load the block just to look at the location the block is not loadable in exams so clean fails in that IDA, but we shouldn't need the block to ask a question about the course --- CHANGELOG.rst | 6 ++++++ lti_consumer/__init__.py | 2 +- lti_consumer/models.py | 3 +-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e8af856..7b70f25 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,6 +16,12 @@ Please See the [releases tab](https://github.com/openedx/xblock-lti-consumer/rel Unreleased ~~~~~~~~~~ +======= +7.0.1 - 2022-11-29 +------------------ + +Fix LtiConfiguration clean method to look only at location so that it can work in environments that cannot load the block. + 7.0.0 - 2022-11-29 ------------------ * Refactor anonymous user to real user rebinding function to use `rebind_user` service. diff --git a/lti_consumer/__init__.py b/lti_consumer/__init__.py index df365c4..a920083 100644 --- a/lti_consumer/__init__.py +++ b/lti_consumer/__init__.py @@ -4,4 +4,4 @@ Runtime will load the XBlock class from here. from .apps import LTIConsumerApp from .lti_xblock import LtiConsumerXBlock -__version__ = '7.0.0' +__version__ = '7.0.1' diff --git a/lti_consumer/models.py b/lti_consumer/models.py index f96f5f7..15de62c 100644 --- a/lti_consumer/models.py +++ b/lti_consumer/models.py @@ -240,8 +240,7 @@ class LtiConfiguration(models.Model): "config_store": _("LTI Configuration stores on XBlock needs a block location set."), }) if self.version == self.LTI_1P3 and self.config_store == self.CONFIG_ON_DB: - block = compat.load_enough_xblock(self.location) - if not database_config_enabled(block.scope_ids.usage_id.context_key): + if not database_config_enabled(self.location.course_key): raise ValidationError({ "config_store": _("LTI Configuration stores on database is not enabled."), }) -- GitLab