From e6d587bffd5c7614735595b12b6de3b45f3ef57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Sun, 25 Feb 2018 20:00:34 +0100 Subject: [PATCH] Actually save to DB a created history --- histories/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/histories/models.py b/histories/models.py index f386eb3..94ddf28 100644 --- a/histories/models.py +++ b/histories/models.py @@ -195,6 +195,8 @@ def generate_history(user, ts_start): # let's define a new history object. history = History(start_ts=ts_start, user=user) length = HISTORY_MIN + floor(10 * random.weibullvariate(1, 1.5)) + history.full_clean() + history.save() history_line = 0 @@ -208,4 +210,7 @@ def generate_history(user, ts_start): timestamp=timestamp, history=history ) + new_line.full_clean() new_line.save() + + return history