fixed public share links

This commit is contained in:
vabene1111
2021-04-10 14:36:56 +02:00
parent e88fb88d8a
commit f21de5eddc
3 changed files with 6 additions and 4 deletions

View File

@ -27,7 +27,7 @@ from cookbook.helper.ingredient_parser import parse
from cookbook.helper.permission_helper import (CustomIsAdmin, CustomIsGuest,
CustomIsOwner, CustomIsShare,
CustomIsShared, CustomIsUser,
group_required)
group_required, share_link_valid)
from cookbook.helper.recipe_url_import import get_from_html, get_from_scraper, find_recipe_json
from cookbook.models import (CookLog, Food, Ingredient, Keyword, MealPlan,
MealType, Recipe, RecipeBook, ShoppingList,
@ -284,7 +284,9 @@ class RecipeViewSet(viewsets.ModelViewSet, StandardFilterMixin):
permission_classes = [CustomIsShare | CustomIsGuest]
def get_queryset(self):
self.queryset = self.queryset.filter(space=self.request.space)
share = self.request.query_params.get('share', None)
if not (share and self.detail):
self.queryset = self.queryset.filter(space=self.request.space)
internal = self.request.query_params.get('internal', None)
if internal: