Skip to content

Commit

Permalink
Merge pull request #27 from djoamersfoort/feat/roles-set-intersection
Browse files Browse the repository at this point in the history
feat: use set intersection for role check in sync
  • Loading branch information
wipeautcrafter authored Mar 17, 2024
2 parents 21c78fa + 877ad03 commit 6cf24ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions corvee/src/corvee.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@


class Corvee:

type_filter = {'member', 'senior', 'strippenkaart'}

@staticmethod
def is_sync_needed():
try:
Expand All @@ -37,7 +38,8 @@ def update_members(access_token):

members = response.json()
for member in members:
if 'member' not in member['types'] and 'strippenkaart' not in member['types']:
type_set = set(member['types'])
if not self.type_filter.intersection(type_set):
continue

try:
Expand Down

0 comments on commit 6cf24ea

Please sign in to comment.