From db938019226d2116c6e835f57a20ead64b83d35c Mon Sep 17 00:00:00 2001 From: Jordan Hyatt Date: Sat, 10 Feb 2024 08:03:03 -0500 Subject: [PATCH] made updates per PR conversation --- django_tables2/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/django_tables2/utils.py b/django_tables2/utils.py index 5e1671a0..ba4fdb59 100644 --- a/django_tables2/utils.py +++ b/django_tables2/utils.py @@ -303,12 +303,12 @@ class Accessor(str): "Failed lookup for key [{key}] in {context}, when resolving the accessor {accessor}" ) - def __init__(self, object, *callable_args, **callable_kwargs): - self.callable_args = callable_args - self.callable_kwargs = callable_kwargs + def __init__(self, value, callable_args=None, callable_kwargs=None): + self.callable_args = callable_args or [] + self.callable_kwargs = callable_kwargs or {} super().__init__() - def __new__(cls, value, *args, **kwargs): + def __new__(cls, value, callable_args=None, callable_kwargs=None): instance = super().__new__(cls, value) if cls.LEGACY_SEPARATOR in value: instance.SEPARATOR = cls.LEGACY_SEPARATOR