Fix mock conflict resolution

This commit is contained in:
s3lph 2022-04-17 01:03:34 +02:00
parent 1c517bd8a7
commit 7e0c4a6100

View file

@ -17,6 +17,7 @@ def _resolve(target: str,
# Mock conflict resolution that does not send or prepare messages # Mock conflict resolution that does not send or prepare messages
subs: Dict[str, List[SchleuderSubscriber]] = {} subs: Dict[str, List[SchleuderSubscriber]] = {}
for s in subscriptions: for s in subscriptions:
if s.key is not None:
subs.setdefault(s.email, []).append(s) subs.setdefault(s.email, []).append(s)
return [min(s, key=lambda x: x.created_at) for s in subs.values()] return [min(s, key=lambda x: x.created_at) for s in subs.values()]
@ -116,6 +117,8 @@ def _get_subs(schleuder: SchleuderList):
elif schleuder.id == 6: elif schleuder.id == 6:
return [ return [
SchleuderSubscriber(10, 'aaron.example@example.org', key9, schleuder.id, date2), SchleuderSubscriber(10, 'aaron.example@example.org', key9, schleuder.id, date2),
# No key, should not be subscribed
SchleuderSubscriber(11, 'arno.example@example.org', None, schleuder.id, date1),
] ]
else: else:
return [] return []