From d5648e4557999985274bfca4e7df7d5ecb836c96 Mon Sep 17 00:00:00 2001 From: robz Date: Mon, 6 Apr 2026 07:36:15 -0500 Subject: [PATCH 1/2] make discourse message clearer --- discourseUpdateGroups.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/discourseUpdateGroups.py b/discourseUpdateGroups.py index 2736ce8..19829d3 100644 --- a/discourseUpdateGroups.py +++ b/discourseUpdateGroups.py @@ -64,23 +64,24 @@ def updateTypes(neonAccounts: dict): instructorsMembers = set() wikiAdmins = set() - for account in neonAccounts: - if neonAccounts[account].get("DiscourseID") is None or neonAccounts[account].get("DiscourseID") == "": - if neonUtil.accountIsAnyType(neonAccounts[account]): - logging.warning(f'''{neonAccounts[account]["First Name"]} {neonAccounts[account]["Last Name"]} ({neonAccounts[account]["Account ID"]}) is interesting but has no Discourse ID''') + for account in neonAccounts.values(): + dID = account.get("DiscourseID") + if not dID: + if neonUtil.accountIsAnyType(account): + logging.warning(f'{account["First Name"]} {account["Last Name"]} ({account["Account ID"]}) has type {account.get("Individual Type")} but no Discourse ID') continue - if neonUtil.accountIsType(neonAccounts[account], neonUtil.LEAD_TYPE) or neonUtil.accountIsType(neonAccounts[account], neonUtil.DIRECTOR_TYPE): - leadershipMembers.add(neonAccounts[account].get("DiscourseID")) + if neonUtil.accountIsType(account, neonUtil.LEAD_TYPE) or neonUtil.accountIsType(account, neonUtil.DIRECTOR_TYPE): + leadershipMembers.add(dID) - if neonUtil.accountIsType(neonAccounts[account], neonUtil.STEWARD_TYPE) or neonUtil.accountIsType(neonAccounts[account], neonUtil.SUPER_TYPE): - stewardsMembers.add(neonAccounts[account].get("DiscourseID")) + if neonUtil.accountIsType(account, neonUtil.STEWARD_TYPE) or neonUtil.accountIsType(account, neonUtil.SUPER_TYPE): + stewardsMembers.add(dID) - if neonUtil.accountIsType(neonAccounts[account], neonUtil.INSTRUCTOR_TYPE): - instructorsMembers.add(neonAccounts[account].get("DiscourseID")) + if neonUtil.accountIsType(account, neonUtil.INSTRUCTOR_TYPE): + instructorsMembers.add(dID) - if neonUtil.accountIsType(neonAccounts[account], neonUtil.WIKI_ADMIN_TYPE): - wikiAdmins.add(neonAccounts[account].get("DiscourseID")) + if neonUtil.accountIsType(account, neonUtil.WIKI_ADMIN_TYPE): + wikiAdmins.add(dID) #Discourse is annoying about primary groups - there's no way to set a heirarchy; it's last-one-sticks #Update the "highest rank" group last so users new to multiple groups wind up with the highest title From 696d324f24799c0240cac6540a206f39e8d1ca7a Mon Sep 17 00:00:00 2001 From: robz Date: Mon, 6 Apr 2026 07:44:29 -0500 Subject: [PATCH 2/2] Hide messages about special event group --- openPathUtil.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openPathUtil.py b/openPathUtil.py index 78f14ee..3677405 100644 --- a/openPathUtil.py +++ b/openPathUtil.py @@ -30,6 +30,7 @@ GROUP_DOMINO = 96643 GROUP_ONDUTY = 507223 GROUP_CERAMICS_ONDUTY = 730657 +GROUP_SPECIAL_EVENT = 119566 def isManagedGroup(group: int): if ( @@ -307,12 +308,13 @@ def updateGroups(neonAccount, openPathGroups=None, email=False): # prevent specialty groups from being clobbered if not isManagedGroup(id): - logging.info( - "%s (%s) has unmanaged OpenPath Group ID %s", - neonAccount.get("fullName"), - neonAccount.get("Email 1"), - id, - ) + if id != GROUP_SPECIAL_EVENT: + logging.info( + "%s (%s) has unmanaged OpenPath Group ID %s", + neonAccount.get("fullName"), + neonAccount.get("Email 1"), + id, + ) neonOpGroups.append(id) logging.debug(