Show error once

Show error string only once when deleting a non-existent record by index.

E.g.:

    buku -d non_existent_id

Fix indentation issue.
This commit is contained in:
Arun Prakash Jana 2018-08-05 09:24:22 +05:30
parent c5b39b8491
commit 4b4e5ffe37
No known key found for this signature in database
GPG Key ID: A75979F35C080412

View File

@ -1362,6 +1362,12 @@ class BukuDb:
else: # Remove a single entry
try:
if self.chatty:
self.cur.execute('SELECT COUNT(*) FROM bookmarks WHERE id = ? LIMIT 1', (index,))
count = self.cur.fetchone()
if (count[0] < 1):
logerr('No matching index %d', index)
return False
if self.print_rec(index) is True:
resp = input('Delete this bookmark? (y/n): ')
if resp != 'y':