Skip to content

Commit

Permalink
Merge pull request #193 from vindevoy/issue-192
Browse files Browse the repository at this point in the history
Issue-192: HOTFIX TypeError
  • Loading branch information
vindevoy authored May 8, 2020
2 parents 0e39ddc + 45eef6e commit 4a6adb1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
19 changes: 14 additions & 5 deletions src/application/model/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
###

Expand Down Expand Up @@ -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

Expand All @@ -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)
Expand Down
19 changes: 14 additions & 5 deletions src/application/model/posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
###

Expand Down Expand Up @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit 4a6adb1

Please sign in to comment.