From 9e3af96c01116ea1f10d0cca0953c808ae5eadca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Sun, 6 Mar 2016 12:13:14 +0100 Subject: Fix algorithm in find_candidates - exact match must have preference --- todoist | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/todoist b/todoist index e2ab94f..b247804 100755 --- a/todoist +++ b/todoist @@ -104,7 +104,9 @@ def build_collaborators_list(data): def find_candidate(name, storage): candidates = [] for k, v in storage.items(): - if k.find(name) != -1: + if name == k: + return v, None + elif k.find(name) != -1: candidates.append((k, v)) if len(candidates) == 0: return None, "No candidate found" -- cgit v1.2.3