Add a function to filter users
def _my_users(users):
for user in users:
try:
if not all(cg == "default" for cg in users[user]["group"]):
yield user
except KeyError:
pass
my_users = list(_my_users(users))
for user in my_users:
# ... etc
Gribouillis
Posting Maven
3,101 posts since Jul 2008
Reputation Points: 1,130
Solved Threads: 761
Skill Endorsements: 11
Where is the syntax error ? Are you using a very old version of python ?
Gribouillis
Posting Maven
3,101 posts since Jul 2008
Reputation Points: 1,130
Solved Threads: 761
Skill Endorsements: 11
Sorry, I think I misspelled "group" instead of "groups". Can you try again ? What my code does is that it keeps all users for which there is a category_group in users[user]["groups"] which is different from "default".
Gribouillis
Posting Maven
3,101 posts since Jul 2008
Reputation Points: 1,130
Solved Threads: 761
Skill Endorsements: 11