mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-06 22:58:19 -05:00
modal + link caching
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from django.http import HttpResponse
|
||||
import json
|
||||
|
||||
from cookbook.models import Recipe
|
||||
from cookbook.helper import dropbox
|
||||
@@ -7,5 +6,9 @@ from cookbook.helper import dropbox
|
||||
|
||||
def get_file_link(request, recipe_id):
|
||||
recipe = Recipe.objects.get(id=recipe_id)
|
||||
response = dropbox.get_share_link(recipe.path)
|
||||
return HttpResponse(response['url'])
|
||||
if recipe.link == "":
|
||||
response = dropbox.get_share_link(recipe.path)
|
||||
recipe.link = response['url']
|
||||
recipe.save()
|
||||
|
||||
return HttpResponse(recipe.link)
|
||||
|
||||
Reference in New Issue
Block a user