From be9ca8e0c42b4d327ee0b6721a1c06dce7b1a221 Mon Sep 17 00:00:00 2001 From: Steven K Date: Mon, 11 Nov 2024 14:28:55 -0700 Subject: [PATCH] Fix ValueError message formatting in 'make_xeditable' helper 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. --- datatableview/helpers.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/datatableview/helpers.py b/datatableview/helpers.py index 0b0a637..f396a23 100644 --- a/datatableview/helpers.py +++ b/datatableview/helpers.py @@ -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):