fixed link creation and updated model

This commit is contained in:
vabene1111
2018-06-06 23:31:47 +02:00
parent 2e2144a9e3
commit 8b6f7bd7cb
9 changed files with 23 additions and 46 deletions

View File

@@ -67,7 +67,7 @@ def create_new_recipe(request, import_id):
recipe = Recipe()
recipe.storage = new_recipe.storage
recipe.name = form.cleaned_data['name']
recipe.path = form.cleaned_data['path']
recipe.file_path = form.cleaned_data['file_path']
recipe.file_uid = form.cleaned_data['file_uid']
recipe.category = form.cleaned_data['category']
@@ -83,6 +83,6 @@ def create_new_recipe(request, import_id):
messages.add_message(request, messages.ERROR, _('There was an error importing this recipe!'))
else:
new_recipe = RecipeImport.objects.get(id=import_id)
form = ImportRecipeForm(initial={'path': new_recipe.path, 'name': new_recipe.name, 'file_uid': new_recipe.file_uid})
form = ImportRecipeForm(initial={'file_path': new_recipe.file_path, 'name': new_recipe.name, 'file_uid': new_recipe.file_uid})
return render(request, 'forms/edit_import_recipe.html', {'form': form})