From 5ca1623761fe7278e0061472fa8bdd641f8963da Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 8 Jun 2019 18:49:16 +0200 Subject: [PATCH] Improve year and editor matching --- manuels/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manuels/views.py b/manuels/views.py index f2273df..253848e 100644 --- a/manuels/views.py +++ b/manuels/views.py @@ -323,7 +323,7 @@ def isbn_api(request, isbn): extra_info = extra_info[0].get_text(strip=True) logger.debug('extra_info') logger.debug(extra_info) - matches = re.search(r'Date de parution(?: :)?\d{2}/\d{2}/(?P\d{4})Editeur(?: :)?(?P[\w ]+)ISBN', extra_info) + matches = re.search(r'Date de parution(?: :)?\d{2}/\d{2}/(?P\d{4})Editeur(?: :)?(?P.+?)(?:ISBN|Collection)', extra_info) if matches: groups = matches.groupdict() year = groups.get('year')