Skip to content

Commit fa17ddd

Browse files
larseggertrjsparks
andauthored
refactor: tweak the horrible code in SearchableField (ietf-tools#3957)
* Fix: Tweak the horrible code in SearchableField so another corner case works Fixes ietf-tools#3940. Hopefully doesn't break anything. * fix: remove incorrect remaining loop. Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
1 parent 8ef9231 commit fa17ddd

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

ietf/utils/fields.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,7 @@ def prepare_value(self, value):
264264
value = value[0]
265265
else:
266266
if not isinstance(value[0], self.model):
267-
qs = self.get_model_instances(value[0])
268-
for val in value[1:]:
269-
qs = qs.union(self.get_model_instances(val))
270-
value = qs
267+
value = self.get_model_instances(value)
271268
if isinstance(value, int):
272269
value = str(value)
273270
if isinstance(value, str):
@@ -343,4 +340,4 @@ def update_dimension_fields(self, *args, **kwargs):
343340
try:
344341
super().update_dimension_fields(*args, **kwargs)
345342
except FileNotFoundError:
346-
pass # don't do anything if the file has gone missing
343+
pass # don't do anything if the file has gone missing

0 commit comments

Comments
 (0)