mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-06 14:48:02 -05:00
catch attibute error when scrape missing schema
This commit is contained in:
@@ -16,7 +16,7 @@ def get_from_scraper(scrape, space):
|
|||||||
recipe_json = {}
|
recipe_json = {}
|
||||||
try:
|
try:
|
||||||
recipe_json['name'] = parse_name(scrape.title() or scrape.schema.data.get('name') or '')
|
recipe_json['name'] = parse_name(scrape.title() or scrape.schema.data.get('name') or '')
|
||||||
except TypeError:
|
except (TypeError, AttributeError):
|
||||||
recipe_json['name'] = ''
|
recipe_json['name'] = ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
|
|||||||
"""
|
"""
|
||||||
import ast
|
import ast
|
||||||
import os
|
import os
|
||||||
import random
|
|
||||||
import string
|
|
||||||
|
|
||||||
from corsheaders.defaults import default_headers
|
from corsheaders.defaults import default_headers
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
|
|||||||
Reference in New Issue
Block a user