fixed importer and copy recipe

This commit is contained in:
vabene1111
2022-09-23 16:43:22 +02:00
parent 13b91e5b91
commit 12a8582a9a
2 changed files with 6 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ def get_from_scraper(scrape, request):
# converting the scrape_me object to the existing json format based on ld+json
recipe_json = {}
try:
recipe_json['name'] = parse_name(scrape.title() or None)
recipe_json['name'] = parse_name(scrape.title()[:128] or None)
except Exception:
recipe_json['name'] = None
if not recipe_json['name']:

View File

@@ -721,8 +721,8 @@ class RecipeSerializer(RecipeBaseSerializer):
steps = StepSerializer(many=True)
keywords = KeywordSerializer(many=True)
shared = UserSerializer(many=True, required=False)
rating = CustomDecimalField(required=False, allow_null=True)
last_cooked = serializers.DateTimeField(required=False, allow_null=True)
rating = CustomDecimalField(required=False, allow_null=True, read_only=True)
last_cooked = serializers.DateTimeField(required=False, allow_null=True, read_only=True)
class Meta:
model = Recipe