Skip to content
Snippets Groups Projects
Commit 1f4a0dc2 authored by Dylann Cordel's avatar Dylann Cordel :crossed_swords:
Browse files

fix error when news have not end publication datetime p/tango#240

parent 7b95be6f
No related branches found
No related tags found
No related merge requests found
......@@ -307,7 +307,7 @@ class NewsboxExpiredBase(six.with_metaclass(NewsboxModelBase, models.Model)):
def publish(self, commit=True):
updated = super(NewsboxExpiredBase, self).publish(commit=False)
now_datetime = now()
if now_datetime > self.newsbox_publication_end_date:
if self.newsbox_publication_end_date and now_datetime > self.newsbox_publication_end_date:
self.newsbox_publication_end_date = None
updated = True
if updated and commit:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment