mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
improved pdf viewer
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
from annoying.decorators import ajax_request
|
||||
from annoying.functions import get_object_or_None
|
||||
from django.contrib import messages
|
||||
from django.http import HttpResponse
|
||||
from django.http import HttpResponse, FileResponse
|
||||
from django.shortcuts import redirect
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
@@ -44,7 +45,7 @@ def get_recipe_file(request, recipe_id):
|
||||
if not recipe.cors_link:
|
||||
update_recipe_links(recipe)
|
||||
|
||||
return HttpResponse(get_recipe_provider(recipe).get_base64_file(recipe))
|
||||
return FileResponse(get_recipe_provider(recipe).get_file(recipe))
|
||||
|
||||
|
||||
@group_required('user')
|
||||
|
||||
@@ -10,6 +10,7 @@ from django.db.models import Q
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import render, get_object_or_404
|
||||
from django.utils import timezone
|
||||
from django.views.decorators.clickjacking import xframe_options_exempt
|
||||
from django_tables2 import RequestConfig
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
|
||||
Reference in New Issue
Block a user