mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-05 06:08:46 -05:00
view local recipes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from django.contrib import messages
|
||||
from django.http import HttpResponse
|
||||
from django.http import HttpResponse, HttpResponseRedirect
|
||||
from django.urls import reverse_lazy, reverse
|
||||
from django.utils.translation import gettext as _
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.shortcuts import redirect
|
||||
@@ -12,6 +13,8 @@ from cookbook.helper import dropbox
|
||||
def get_file_link(request, recipe_id):
|
||||
recipe = Recipe.objects.get(id=recipe_id)
|
||||
|
||||
if recipe.instructions:
|
||||
return HttpResponse(reverse('view_recipe', args=[recipe_id]))
|
||||
if recipe.storage.method == Storage.DROPBOX:
|
||||
if recipe.link == "":
|
||||
recipe.link = dropbox.get_share_link(recipe) # TODO response validation
|
||||
|
||||
Reference in New Issue
Block a user