Skip to content
Snippets Groups Projects
Commit 0be65a54 authored by usamasadiq's avatar usamasadiq
Browse files

update-log-messages

parent 90537d42
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@ def parse_result_json(json_str):
try:
json_obj = json.loads(json_str)
except (ValueError, TypeError) as err:
msg = f"Supplied JSON string in request body could not be decoded: {json_str}"
msg = f"Supplied JSON string in request body could not be decoded: {json_str!r}"
log.error("[LTI] %s", msg)
raise Lti1p1Error(msg) from err
......@@ -87,7 +87,7 @@ def parse_result_json(json_str):
# '@type' must be "Result"
result_type = json_obj.get("@type")
if result_type != "Result":
msg = f"JSON object does not contain correct @type attribute (should be 'Result', is z{result_type})"
msg = f"JSON object does not contain correct @type attribute (should be 'Result', is z{result_type!r})"
log.error("[LTI] %s", msg)
raise Lti1p1Error(msg)
......
......@@ -32,7 +32,7 @@ class UsageKeyField(serializers.Field):
try:
return UsageKey.from_string(data)
except InvalidKeyError as err:
raise serializers.ValidationError(f"Invalid usage key: {data}") from err
raise serializers.ValidationError(f"Invalid usage key: {data!r}") from err
class LtiAgsLineItemSerializer(serializers.ModelSerializer):
......
......@@ -6,8 +6,12 @@ from unittest.mock import Mock, patch
from Cryptodome.PublicKey import RSA
from django.test.testcases import TestCase
from lti_consumer.api import (_get_or_create_local_lti_config, get_lti_1p3_launch_info, get_lti_1p3_launch_start_url,
get_lti_consumer)
from lti_consumer.api import (
_get_or_create_local_lti_config,
get_lti_1p3_launch_info,
get_lti_1p3_launch_start_url,
get_lti_consumer
)
from lti_consumer.lti_xblock import LtiConsumerXBlock
from lti_consumer.models import LtiConfiguration
from lti_consumer.tests.unit.test_utils import make_xblock
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment