From ed49e63576f8809a814191a3a50ac89d1709f419 Mon Sep 17 00:00:00 2001 From: KlemenSpruk Date: Tue, 12 Sep 2023 13:21:57 +0200 Subject: [PATCH] bug fix (#197) --- dynamicforms/mixins/related_field_ajax.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dynamicforms/mixins/related_field_ajax.py b/dynamicforms/mixins/related_field_ajax.py index e12c96bb..c1cdf8a0 100644 --- a/dynamicforms/mixins/related_field_ajax.py +++ b/dynamicforms/mixins/related_field_ajax.py @@ -115,6 +115,8 @@ def render_to_table(self, value, row_data): cr = self.child_relation if isinstance(value, BaseManager): value = value.all() + if value is None: + return "" return ", ".join((cr.display_value(item) for item in value)) # return ', '.join((cr.display_value(item) for item in cr.get_queryset().filter(pk__in=value))) elif isinstance(self, RelatedField):