Skip to content

Commit

Permalink
(fix) can handle no friends input
Browse files Browse the repository at this point in the history
  • Loading branch information
azai91 committed Nov 22, 2015
1 parent 3a3e422 commit 0690032
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/venmo_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ def show_filtered_friends(cls, user_input):
user_input, user inputted string in Alfred bar.
"""

try:
friends = cls.findFriends(user_input)
friends = cls.findFriends(user_input)
if len(friends):
cls.show_friends(friends)
except:
else:
wf.add_item(
title='No friends found',
icon=ICON_WARNING)
Expand Down Expand Up @@ -354,5 +354,5 @@ def generate_payload(cls, user_input, friend):
'user_id' : friend['id'],
'amount' : amount,
'note' : note,
'display_name' : friend['display_name']
'display_name' : friend['display_name'] # for printing out name in push notification
}
3 changes: 2 additions & 1 deletion tests/venmo_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import sys
from src.config import LOGIN, LOGOUT, INVALID, CLEAR_CACHE

from src.venmo import main, wf
from src.venmo import main
from src.venmo_api import wf

class TestVenmo(unittest.TestCase):

Expand Down

0 comments on commit 0690032

Please sign in to comment.