From 5ef55303923670ba3500f943231216e150e4494f Mon Sep 17 00:00:00 2001 From: its_me_gb Date: Fri, 30 Apr 2021 08:40:00 +0100 Subject: [PATCH] Move the source url back into the step - inline with other importers --- cookbook/integration/recettetek.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cookbook/integration/recettetek.py b/cookbook/integration/recettetek.py index bf3482851..3ebfd3b91 100644 --- a/cookbook/integration/recettetek.py +++ b/cookbook/integration/recettetek.py @@ -42,6 +42,14 @@ class RecetteTek(Integration): step = Step.objects.create(instruction=file['instructions']) + # Append the original import url to the step (if it exists) + try: + if file['url'] != '': + step.instruction += '\n\nImported from: ' + file['url'] + step.save() + except Exception as e: + print(recipe.name, ': failed to import source url ', str(e)) + try: # Process the ingredients. Assumes 1 ingredient per line. for ingredient in file['ingredients'].split('\n'): @@ -87,13 +95,6 @@ class RecetteTek(Integration): recipe.save() - # Append the original import url to the description if it exists - try: - if file['url'] != '': - recipe.description += "\n\nOriginal Source: " + file['url'] - except Exception as e: - print(recipe.name, ': failed to import source url ', str(e)) - # TODO: Parse Nutritional Information # Import the original image from the zip file, if we cannot do that, attempt to download it again.