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

File diff suppressed because one or more lines are too long

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:

View File

@ -41,7 +41,7 @@ export function apiLoadCookBooks(query) {
return axios.get(resolveDjangoUrl('api:recipebook-list') + '?query=' + query).then((response) => {
return response.data
}).catch((err) => {
handleError(err, 'There was an error creating a resource!', 'danger')
//handleError(err, 'There was an error loading a resource!', 'danger')
})
}