Skip to content

Commit

Permalink
Add invalid accessor string to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jieter committed Oct 19, 2019
1 parent 5c2eece commit 4962816
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion django_tables2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ class Accessor(str):

def __new__(cls, value):
if "." in value:
raise ValueError("Use '__' to separate path components, not '.'.")
raise ValueError(
"Use '__' to separate path components, not '.' in accessor '{}'.".format(value)
)
return super().__new__(cls, value)

def resolve(self, context, safe=True, quiet=False):
Expand Down

0 comments on commit 4962816

Please sign in to comment.