aboutsummaryrefslogtreecommitdiffstats
path: root/todoist
diff options
context:
space:
mode:
authorGravatar Robin Obůrka <r.oburka@gmail.com> 2016-03-06 12:13:14 +0100
committerGravatar Robin Obůrka <r.oburka@gmail.com> 2016-03-06 12:13:14 +0100
commit9e3af96c01116ea1f10d0cca0953c808ae5eadca (patch)
tree03665c3142b9da6c65ec2f254b1a3adca2d39fc0 /todoist
parentProvide new interface for --dump operation (diff)
downloadtodoist-master.tar.xz
Fix algorithm in find_candidates - exact match must have preferenceHEADmaster
Diffstat (limited to 'todoist')
-rwxr-xr-xtodoist4
1 files changed, 3 insertions, 1 deletions
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"