From 1615a0292722f1fbbbc67a77362b40a023fdebb9 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Wed, 23 May 2018 14:43:12 +0200 Subject: [PATCH] fix preview_until --- src/catalogue/models/book.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index 696b4afb0..027d272a3 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -3,7 +3,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from collections import OrderedDict -from datetime import date +from datetime import date, timedelta from random import randint import os.path import re @@ -433,7 +433,7 @@ class Book(models.Model): old_cover = None book.preview = bool(days) if book.preview: - book.preview_until = date.today() + book.preview_until = date.today() + timedelta(days) else: if not overwrite: raise Book.AlreadyExists(_('Book %s already exists') % book_slug) -- 2.20.1