mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-09 16:18:00 -05:00
fixed importer and copy recipe
This commit is contained in:
@@ -21,7 +21,7 @@ def get_from_scraper(scrape, request):
|
|||||||
# converting the scrape_me object to the existing json format based on ld+json
|
# converting the scrape_me object to the existing json format based on ld+json
|
||||||
recipe_json = {}
|
recipe_json = {}
|
||||||
try:
|
try:
|
||||||
recipe_json['name'] = parse_name(scrape.title() or None)
|
recipe_json['name'] = parse_name(scrape.title()[:128] or None)
|
||||||
except Exception:
|
except Exception:
|
||||||
recipe_json['name'] = None
|
recipe_json['name'] = None
|
||||||
if not recipe_json['name']:
|
if not recipe_json['name']:
|
||||||
|
|||||||
@@ -721,8 +721,8 @@ class RecipeSerializer(RecipeBaseSerializer):
|
|||||||
steps = StepSerializer(many=True)
|
steps = StepSerializer(many=True)
|
||||||
keywords = KeywordSerializer(many=True)
|
keywords = KeywordSerializer(many=True)
|
||||||
shared = UserSerializer(many=True, required=False)
|
shared = UserSerializer(many=True, required=False)
|
||||||
rating = CustomDecimalField(required=False, allow_null=True)
|
rating = CustomDecimalField(required=False, allow_null=True, read_only=True)
|
||||||
last_cooked = serializers.DateTimeField(required=False, allow_null=True)
|
last_cooked = serializers.DateTimeField(required=False, allow_null=True, read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Recipe
|
model = Recipe
|
||||||
|
|||||||
Reference in New Issue
Block a user