Skip to content

Commit

Permalink
feat: use set intersection for role check in sync
Browse files Browse the repository at this point in the history
  • Loading branch information
wipeautcrafter authored Mar 16, 2024
1 parent 21c78fa commit 877ad03
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 877ad03

Please sign in to comment.