Fix #235: skip bookmark add if edit aborted

This commit is contained in:
Arun Prakash Jana 2017-11-14 21:57:14 +05:30
parent 311ca2fa29
commit e00e3eee18
No known key found for this signature in database
GPG Key ID: A75979F35C080412

10
buku.py
View File

@ -4158,15 +4158,19 @@ POSITIONAL ARGUMENTS:
tags = parse_tags(keywords[1:])
url = args.add[0]
edit_aborted = False
if args.write and not is_int(args.write):
result = edit_rec(args.write, url, title_in, tags, desc_in)
if result is not None:
url, title_in, tags, desc_in = result
else:
edit_aborted = True
if args.suggest:
tags = bdb.suggest_similar_tag(tags)
bdb.add_rec(url, title_in, tags, desc_in, args.immutable)
if edit_aborted == False:
if args.suggest:
tags = bdb.suggest_similar_tag(tags)
bdb.add_rec(url, title_in, tags, desc_in, args.immutable)
# Enable browser output in case of a text based browser
if os.getenv('BROWSER') in ['elinks', 'links', 'lynx', 'w3m', 'links2']: