disable external recipes in hosted version

This commit is contained in:
vabene1111
2021-11-04 15:56:22 +01:00
parent 4b5edb4230
commit d681e3ced3
4 changed files with 20 additions and 9 deletions

View File

@ -25,6 +25,7 @@ from cookbook.helper.recipe_url_import import parse_cooktime
from cookbook.models import (Comment, Food, Ingredient, Keyword, Recipe,
RecipeImport, Step, Sync, Unit, UserPreference)
from cookbook.tables import SyncTable
from recipes import settings
@group_required('user')
@ -37,6 +38,10 @@ def sync(request):
messages.add_message(request, messages.WARNING, _('You have more users than allowed in your space.'))
return HttpResponseRedirect(reverse('index'))
if request.space.demo or settings.HOSTED:
messages.add_message(request, messages.ERROR, _('This feature is not yet available in the hosted version of tandoor!'))
return redirect('index')
if request.method == "POST":
if not has_group_permission(request.user, ['admin']):
messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!'))