Skip to content

Commit 622ba74

Browse files
author
Paul Philion
committed
minor tweak to avoid zero IDs
1 parent 40dc229 commit 622ba74

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

netbot/netbot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,15 +446,15 @@ def discord_ids_for_team(self, team: Team) -> set[int]:
446446
for named in team.users:
447447
user = self.redmine.user_mgr.cache.get(named.id) #expected to be cached
448448
if user:
449-
if user.discord_id:
450-
discord_ids.add(user.discord_id.id)
449+
if user.discord_id and user.discord_id.id > 0:
450+
discord_ids.add(user.discord_id.id) # <-- data might have 0
451451
else:
452452
log.info(f"No Discord ID for {named}")
453453
elif self.redmine.user_mgr.is_team(named.name):
454454
# a team, look up role it.
455455
team = self.get_role_by_name(named.name)
456456
if team:
457-
discord_ids.add(f"&{team.id}")
457+
discord_ids.add(f"&{team.id}") # <-- is this valid for roles?
458458
else:
459459
log.warning(f"Team name {named} has no matching Discord role.")
460460
else:

0 commit comments

Comments
 (0)