Skip to content

Commit

Permalink
Merge pull request #1328 from ubyssey/fix-nonetype-pubdate
Browse files Browse the repository at this point in the history
Added a case for when the pubdate is None
  • Loading branch information
SamuelmdLow authored Oct 25, 2023
2 parents 37088f0 + 157b536 commit 27123b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions article/templatetags/articletags.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def get_section_title(value):

@register.filter(name='display_pubdate')
def display_pubdate(value):

if value == None:
return "Unknown"

timedif = datetime.timedelta(hours=-7)

pubdate = value + timedif
Expand Down

0 comments on commit 27123b4

Please sign in to comment.