mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
basic space stuff
This commit is contained in:
@@ -49,7 +49,7 @@ def import_recipe(request):
|
||||
@group_required('user')
|
||||
def export_recipe(request):
|
||||
if request.method == "POST":
|
||||
form = ExportForm(request.POST)
|
||||
form = ExportForm(request.POST, user=request.user)
|
||||
if form.is_valid():
|
||||
try:
|
||||
integration = get_integration(request, form.cleaned_data['type'])
|
||||
@@ -58,11 +58,11 @@ def export_recipe(request):
|
||||
messages.add_message(request, messages.ERROR, _('Exporting is not implemented for this provider'))
|
||||
|
||||
else:
|
||||
form = ExportForm()
|
||||
form = ExportForm(user=request.user)
|
||||
recipe = request.GET.get('r')
|
||||
if recipe:
|
||||
if re.match(r'^([0-9])+$', recipe):
|
||||
if recipe := Recipe.objects.filter(pk=int(recipe)).first():
|
||||
form = ExportForm(initial={'recipes': recipe})
|
||||
form = ExportForm(initial={'recipes': recipe}, user=request.user)
|
||||
|
||||
return render(request, 'export.html', {'form': form})
|
||||
|
||||
Reference in New Issue
Block a user