Actually save to DB a created history

This commit is contained in:
Théophile Bastian 2018-02-25 20:00:34 +01:00
parent 8baf408e02
commit e6d587bffd

View file

@ -195,6 +195,8 @@ def generate_history(user, ts_start):
# let's define a new history object. # let's define a new history object.
history = History(start_ts=ts_start, user=user) history = History(start_ts=ts_start, user=user)
length = HISTORY_MIN + floor(10 * random.weibullvariate(1, 1.5)) length = HISTORY_MIN + floor(10 * random.weibullvariate(1, 1.5))
history.full_clean()
history.save()
history_line = 0 history_line = 0
@ -208,4 +210,7 @@ def generate_history(user, ts_start):
timestamp=timestamp, timestamp=timestamp,
history=history history=history
) )
new_line.full_clean()
new_line.save() new_line.save()
return history