Skip to content

Commit

Permalink
fix(bases): avoid duplicated part/equipment tags
Browse files Browse the repository at this point in the history
Avoid reporting duplicated tags when defined on both parent part and
equipment.

fix #77
  • Loading branch information
rezib committed Mar 20, 2024
1 parent 3337bd5 commit 083701f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ and this project adheres to
overriden by specialized classes.
- Fix folded equipment name filtering (#73).
- Add missing raise instructions in some DB format error cases.
- Avoid reporting duplicated tags when defined on both parent part and
equipment (#77).
- web:
- Send HTTP/400 status code when JSON error instead of crashing with
exception in case of error when drawing an infrastructure or a room.
Expand Down
5 changes: 4 additions & 1 deletion racksdb/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ def tags(self):
# RacksDB{Node,StorageEquipment,NetworkEquipment,MiscEquipment} loaded tags are
# renamed with loaded prefix to avoid conflict with this property.
for tag in getattr(self, f"{self.LOADED_PREFIX}tags", []):
result.append(tag)
# Avoid duplicate tags that could be defined on both parent part and
# equipment.
if tag not in result:
result.append(tag)
return result

@cached_property
Expand Down

0 comments on commit 083701f

Please sign in to comment.