From 45eef6e684cce807527b1e21c8829265b5c6ce84 Mon Sep 17 00:00:00 2001 From: Yves Vindevogel Date: Fri, 8 May 2020 13:48:10 +0200 Subject: [PATCH] Issue-192: HOTFIX TypeError --- src/application/model/pages.py | 19 ++++++++++++++----- src/application/model/posts.py | 19 ++++++++++++++----- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/application/model/pages.py b/src/application/model/pages.py index c9ced4b..39db26f 100644 --- a/src/application/model/pages.py +++ b/src/application/model/pages.py @@ -2,13 +2,12 @@ # # Full history: see below # -# Version: 1.3.0 -# Date: 2020-05-01 +# Version: 1.3.1 +# Date: 2020-05-08 # Author: Yves Vindevogel (vindevoy) # -# Features: -# - Removing skipped tags -# - Rewrite date format +# Hotfix: +# - Page with no tags returns a TypeError and not a KeyError # ### @@ -82,6 +81,8 @@ def data(self, page, skip_tags): tags.append(TagsSupport().tag_text(tag)) else: self.__logger.debug('data - removing skipped tag: {0}'.format(tag)) + except TypeError: + pass except KeyError: pass @@ -100,6 +101,14 @@ def data(self, page, skip_tags): ### # +# Version: 1.3.0 +# Date: 2020-05-01 +# Author: Yves Vindevogel (vindevoy) +# +# Features: +# - Removing skipped tags +# - Rewrite date format +# # Version: 1.2.0 # Date: 2020-04-17 # Author: Yves Vindevogel (vindevoy) diff --git a/src/application/model/posts.py b/src/application/model/posts.py index 3d52517..2d3bbb6 100644 --- a/src/application/model/posts.py +++ b/src/application/model/posts.py @@ -2,13 +2,12 @@ # # Full history: see below # -# Version: 1.3.0 -# Date: 2020-05-01 +# Version: 1.3.1 +# Date: 2020-05-08 # Author: Yves Vindevogel (vindevoy) # -# Features: -# - Removing skipped tags -# - Rewrite date format +# Hotfix: +# - Page with no tags returns a TypeError and not a KeyError # ### @@ -82,6 +81,8 @@ def data(self, post, skip_tags): tags.append(TagsSupport().tag_text(tag)) else: self.__logger.debug('data - removing skipped tag: {0}'.format(tag)) + except TypeError: + pass except KeyError: pass @@ -100,6 +101,14 @@ def data(self, post, skip_tags): ### # +# Version: 1.3.0 +# Date: 2020-05-01 +# Author: Yves Vindevogel (vindevoy) +# +# Features: +# - Removing skipped tags +# - Rewrite date format +# # Version: 1.2.0 # Date: 2020-04-17 # Author: Yves Vindevogel (vindevoy)