Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion netbox/extras/conditions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import functools
import re
from collections import OrderedDict

__all__ = (
'Condition',
Expand Down Expand Up @@ -103,7 +104,14 @@ def eval_in(self, value):
return value in self.value

def eval_contains(self, value):
return self.value in value
# For tags because tags are list of dicts
if (type(value) is list and
value and
type(next(iter(value))) is OrderedDict and
next(iter(value)) is not None):
return next((item for item in value if item["slug"] == self.value), None) is not None
else:
return self.value in value

# Regular expressions

Expand Down