Skip to content

Commit 83a39a8

Browse files
feat(numericalInput): fix typos and pylint error
1 parent 70a198b commit 83a39a8

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

cms/djangoapps/contentstore/api/views/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from opaque_keys.edx.keys import CourseKey
99
from rest_framework import status
1010
from rest_framework.generics import GenericAPIView
11+
1112
from common.djangoapps.student.auth import has_course_author_access
1213
from openedx.core.djangoapps.util.forms import to_bool
1314
from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin, view_auth_classes

xmodule/capa/inputtypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ def preview_formcalc(self, get):
13081308
result["preview"] = numeric_result["preview"]
13091309
if numeric_result["error"]:
13101310
result["error"] = numeric_result["error"]
1311-
# if formula is invalid retrn formula
1311+
# if formula is invalid return formula
13121312
if not numeric_result["is_valid"]:
13131313
result["formula"] = formula
13141314

xmodule/capa_block.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ def preview_numeric_input(cls, formula):
24072407
result["error"] = "Sorry, couldn't parse formula"
24082408
result['is_valid'] = False
24092409
return result
2410-
except Exception:
2410+
except (ValueError, TypeError):
24112411
log.warning("Error while previewing formula", exc_info=True)
24122412
result['error'] = "Error while rendering preview"
24132413
result['is_valid'] = False

0 commit comments

Comments
 (0)