mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-09 16:18:00 -05:00
Added export from url args
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
<script type="application/javascript">
|
||||
window.EXPORT_ID = {{pk}};
|
||||
window.CUSTOM_LOCALE = '{{ request.LANGUAGE_CODE }}'
|
||||
window.CUSTOM_LOCALE = '{{ request.LANGUAGE_CODE }}';
|
||||
</script>
|
||||
|
||||
{% render_bundle 'export_view' %}
|
||||
|
||||
@@ -143,14 +143,12 @@ def export_recipe(request):
|
||||
)
|
||||
|
||||
else:
|
||||
form = ExportForm(space=request.space)
|
||||
recipe = request.GET.get('r')
|
||||
if recipe:
|
||||
if re.match(r'^([0-9])+$', recipe):
|
||||
if recipe := Recipe.objects.filter(pk=int(recipe), space=request.space).first():
|
||||
form = ExportForm(initial={'recipes': recipe}, space=request.space)
|
||||
recipe = Recipe.objects.filter(pk=int(recipe), space=request.space).first()
|
||||
|
||||
return render(request, 'export.html', {'form': form})
|
||||
return render(request, 'export.html', {'pk': recipe.pk})
|
||||
|
||||
|
||||
@group_required('user')
|
||||
|
||||
Reference in New Issue
Block a user