actually apply limits everywhere

This commit is contained in:
vabene1111
2021-06-04 17:05:03 +02:00
parent bfe72210df
commit 388ef32475
4 changed files with 29 additions and 4 deletions

View File

@ -45,7 +45,7 @@ def convert_recipe(request, pk):
@group_required('user')
def internal_recipe_update(request, pk):
if request.space.max_recipes != 0 and Recipe.objects.filter(space=request.space).count() > request.space.max_recipes:
if request.space.max_recipes != 0 and Recipe.objects.filter(space=request.space).count() > request.space.max_recipes: # TODO move to central helper function
messages.add_message(request, messages.WARNING, _('You have reached the maximum number of recipes for your space.'))
return HttpResponseRedirect(reverse('view_recipe', args=[pk]))