Exception handling
This commit is contained in:
parent
bdfa285e6b
commit
5d4bd30e20
1 changed files with 6 additions and 2 deletions
|
@ -9,6 +9,7 @@ from math import floor
|
|||
from xml.etree import ElementTree as ET
|
||||
from datetime import datetime
|
||||
from django.db import models
|
||||
from django.core.exceptions import ValidationError
|
||||
import profiles.models as profiles
|
||||
from crawl import crawl
|
||||
from pinocchio.settings import HISTORY_MIN
|
||||
|
@ -239,7 +240,10 @@ def generate_history(user, start_time):
|
|||
timestamp=datetime.fromtimestamp(timestamp),
|
||||
history=history
|
||||
)
|
||||
try:
|
||||
new_line.full_clean()
|
||||
new_line.save()
|
||||
except ValidationError:
|
||||
pass
|
||||
|
||||
return history
|
||||
|
|
Loading…
Reference in a new issue