From a99da9be6985993b9fb9c14047c7a5429dde72b8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 21 Jul 2016 08:44:39 +0530 Subject: [PATCH] Edit metadata dialog: Fix pasting ISBN from clipboard not stripping garbage characters after a valid ISBN. Fixes #1604956 [paste ISBN button regular expression](https://bugs.launchpad.net/calibre/+bug/1604956) --- src/calibre/gui2/metadata/basic_widgets.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/metadata/basic_widgets.py b/src/calibre/gui2/metadata/basic_widgets.py index 323fd55953..6ebc5851e6 100644 --- a/src/calibre/gui2/metadata/basic_widgets.py +++ b/src/calibre/gui2/metadata/basic_widgets.py @@ -1523,9 +1523,11 @@ class IdentifiersEdit(QLineEdit, ToMetadataMixin): text = d.text() if not text: return - vals = self.current_val - vals['isbn'] = text - self.current_val = vals + text = check_isbn(text) + if text: + vals = self.current_val + vals['isbn'] = text + self.current_val = vals # }}}