Skip to content

Commit

Permalink
Make improvements suggested by @lindsay-stevens
Browse files Browse the repository at this point in the history
  • Loading branch information
lognaturel committed Jan 17, 2023
1 parent 816bca0 commit ce6f11a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pyxform/survey_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,10 @@ def xml_label_and_hint(self) -> "List[DetachableElement]":
raise PyXFormError(msg)

# big-image must combine with image
if not ("image" in self.media) and "big-image" in self.media:
raise PyXFormError("You must specify an image in order to use big-image.")
if "image" not in self.media and "big-image" in self.media:
raise PyXFormError(
"To use big-image, you must also specify an image for the survey element named {self.name}."
)

return result

Expand Down
2 changes: 1 addition & 1 deletion tests/test_sheet_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_big_image_invalid_if_no_image(self):
| | text | c | m.png |
""",
errored=True,
error__contains=["must specify an image"],
error__contains=["must also specify an image"],
)

def test_column_case(self):
Expand Down

0 comments on commit ce6f11a

Please sign in to comment.