fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6e3e08e
)
fix preview_until
author
Jan Szejko
<janek37@gmail.com>
Wed, 23 May 2018 12:43:12 +0000
(14:43 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Wed, 23 May 2018 12:43:12 +0000
(14:43 +0200)
src/catalogue/models/book.py
patch
|
blob
|
history
diff --git
a/src/catalogue/models/book.py
b/src/catalogue/models/book.py
index
696b4af
..
027d272
100644
(file)
--- 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
# 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
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:
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)
else:
if not overwrite:
raise Book.AlreadyExists(_('Book %s already exists') % book_slug)