Fix mock conflict resolution
This commit is contained in:
parent
1c517bd8a7
commit
7e0c4a6100
1 changed files with 4 additions and 1 deletions
|
@ -17,7 +17,8 @@ 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:
|
||||||
subs.setdefault(s.email, []).append(s)
|
if s.key is not None:
|
||||||
|
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 []
|
||||||
|
|
Loading…
Reference in a new issue