Skip to content

Commit 5c2900a

Browse files
committed
Improve validation when adding new effects
1 parent d92349e commit 5c2900a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

flixopt/effects.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,10 @@ def __contains__(self, item: Union[str, 'Effect']) -> bool:
313313
if isinstance(item, str):
314314
return item in self.effects # Check if the label exists
315315
elif isinstance(item, Effect):
316-
return item in self.effects.values() # Check if the object exists
316+
if item.label_full in self.effects:
317+
return True
318+
if item in self.effects.values(): # Check if the object exists
319+
return True
317320
return False
318321

319322
@property

0 commit comments

Comments
 (0)