also process strings

This commit is contained in:
Matthias Mair 2025-10-13 15:22:38 +02:00
parent bc298926c1
commit e3b9c7ee49
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A
1 changed files with 3 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import common.models as common_models
import InvenTree.ready
from common.currency import currency_code_default, currency_code_mappings
from InvenTree.fields import InvenTreeRestURLField, InvenTreeURLField
from InvenTree.helpers import str2bool
# region path filtering
@ -79,7 +80,8 @@ class PathScopedMixin(serializers.Serializer):
tgs_vals = {}
for k, v in self.filter_targets.items():
pop_ref = v['name'] or k
tgs_vals[k] = kwargs.pop(pop_ref, None)
val = kwargs.pop(pop_ref, None)
tgs_vals[k] = str2bool(val) if isinstance(val, str) else val
self.filter_target_values = tgs_vals
return kwargs