Verified Commit 14bd031a authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Allow non-existing mailinglists to be created

parent 64edc048
......@@ -23,7 +23,7 @@ class GSuiteSyncService: = name
self.description = description
self.aliases = aliases
self.addresses = addresses
self.addresses = sorted(set(addresses))
def __eq__(self, other: object) -> bool:
if isinstance(other, self.__class__):
......@@ -215,7 +215,7 @@ class GSuiteSyncService:
except HttpError as e:
logger.error('Could not obtain list member data', e.content)
return # the list does not exist or something else is wrong
new_members = set(group.addresses)
new_members = group.addresses
remove_list = [x for x in existing_members if x not in new_members]
insert_list = [x for x in new_members if x not in existing_members
......@@ -253,8 +253,10 @@ class GSuiteSyncService:
aliases=[x.alias for x in mailinglist.aliases.all()],
aliases=([x.alias for x in mailinglist.aliases.all()]
if is not None else []),
if is not None else [])
......@@ -79,7 +79,7 @@ class MailingList(models.Model):
for verbatimaddress in self.addresses.all():
if verbatimaddress.address:
yield verbatimaddress.address
def clean(self):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment