commit
fcdfe6c6a3
1 changed files with 4 additions and 4 deletions
|
|
@ -144,10 +144,10 @@ def load_mariage_to_list(mariages_file: str) -> list:
|
|||
|
||||
|
||||
def find_significant_other(mariages: list, uid: int) -> (int, str):
|
||||
for m in mariages:
|
||||
if m.in_this_union(uid):
|
||||
return m.get_so(uid), m.union()
|
||||
matches = sorted([m for m in mariages if m.in_this_union(uid)], key=lambda union: union.event_date())
|
||||
if not matches:
|
||||
return -1, ''
|
||||
return matches[-1].get_so(uid), matches[-1].union()
|
||||
|
||||
|
||||
def create_events_from_span(start: date, end: date, id_to_person: dict, mariages: list) -> list:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue