Move the source url back into the step - inline with other importers
This commit is contained in:
parent
b9040cb3a4
commit
5ef5530392
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user