Skip to content

Commit

Permalink
Fix ValueError message formatting in 'make_xeditable' helper
Browse files Browse the repository at this point in the history
The existing error message for the 'make_xeditable' helper was split across multiple lines unnecessarily. This commit consolidates the message into fewer lines, improving readability and maintaining the same information.
  • Loading branch information
rh0dium committed Nov 11, 2024
1 parent 7c6e66a commit be9ca8e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions datatableview/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,8 @@ def make_xeditable(instance=None, extra_attrs=[], *args, **kwargs): # noqa: C90
# Legacy syntax
field_name = field_name[1]
if isinstance(field_name, (tuple, list)):
raise ValueError(
"'make_xeditable' helper needs a single-field data column," " not {0!r}".format(
field_name
)
)
msg = f"'make_xeditable' helper needs a single-field data column, not {field_name!r}"
raise ValueError(msg)
attrs["data-name"] = field_name

if isinstance(rich_data, Model):
Expand Down

0 comments on commit be9ca8e

Please sign in to comment.