From dccdb7cc2f674fd81ebee5ff3c4abca607b55d96 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 20:50:58 +0000 Subject: [PATCH 1/2] Bump cryptography from 42.0.2 to 42.0.4 Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.2 to 42.0.4. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/42.0.2...42.0.4) --- updated-dependencies: - dependency-name: cryptography dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e799af7ab..cbec64fb6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Django==4.2.10 -cryptography===42.0.2 +cryptography===42.0.4 django-annoying==0.10.6 django-autocomplete-light==3.9.7 django-cleanup==8.0.0 From 6de68707edc3c9a05f8e380a2c7eee3aa1050b68 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 24 Feb 2024 11:16:09 +0100 Subject: [PATCH 2/2] fixed missing servings get parameter breaking view in some cases --- cookbook/views/views.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/cookbook/views/views.py b/cookbook/views/views.py index 55474494d..6254e83e0 100644 --- a/cookbook/views/views.py +++ b/cookbook/views/views.py @@ -50,7 +50,7 @@ def index(request): # TODO need to deprecate def search(request): - if has_group_permission(request.user, ('guest', )): + if has_group_permission(request.user, ('guest',)): return render(request, 'search.html', {}) else: if request.user.is_authenticated: @@ -130,7 +130,7 @@ def recipe_view(request, pk, share=None): messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!')) return HttpResponseRedirect(reverse('account_login') + '?next=' + request.path) - if not (has_group_permission(request.user, ('guest', )) and recipe.space == request.space) and not share_link_valid(recipe, share): + if not (has_group_permission(request.user, ('guest',)) and recipe.space == request.space) and not share_link_valid(recipe, share): messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!')) return HttpResponseRedirect(reverse('index')) @@ -157,11 +157,11 @@ def recipe_view(request, pk, share=None): if not ViewLog.objects.filter(recipe=recipe, created_by=request.user, created_at__gt=(timezone.now() - timezone.timedelta(minutes=5)), space=request.space).exists(): ViewLog.objects.create(recipe=recipe, created_by=request.user, space=request.space) - if request.method == "GET": + servings = recipe.servings + if request.method == "GET" and 'servings' in request.GET: servings = request.GET.get("servings") return render(request, 'recipe_view.html', - {'recipe': recipe, 'comments': comments, 'comment_form': comment_form, 'share': share, 'servings': servings }) - + {'recipe': recipe, 'comments': comments, 'comment_form': comment_form, 'share': share, 'servings': servings}) @group_required('user') @@ -451,19 +451,19 @@ def web_manifest(request): manifest_info = { "name": - theme_values['app_name'], "short_name": - theme_values['app_name'], "description": - _("Manage recipes, shopping list, meal plans and more."), "icons": - icons, "start_url": - "./search", "background_color": - theme_values['nav_bg_color'], "display": - "standalone", "scope": - ".", "theme_color": - theme_values['nav_bg_color'], "shortcuts": - [{"name": _("Plan"), "short_name": _("Plan"), "description": _("View your meal Plan"), "url": - "./plan"}, {"name": _("Books"), "short_name": _("Books"), "description": _("View your cookbooks"), "url": "./books"}, - {"name": _("Shopping"), "short_name": _("Shopping"), "description": _("View your shopping lists"), "url": - "./list/shopping-list/"}], "share_target": {"action": "/data/import/url", "method": "GET", "params": {"title": "title", "url": "url", "text": "text"}} + theme_values['app_name'], "short_name": + theme_values['app_name'], "description": + _("Manage recipes, shopping list, meal plans and more."), "icons": + icons, "start_url": + "./search", "background_color": + theme_values['nav_bg_color'], "display": + "standalone", "scope": + ".", "theme_color": + theme_values['nav_bg_color'], "shortcuts": + [{"name": _("Plan"), "short_name": _("Plan"), "description": _("View your meal Plan"), "url": + "./plan"}, {"name": _("Books"), "short_name": _("Books"), "description": _("View your cookbooks"), "url": "./books"}, + {"name": _("Shopping"), "short_name": _("Shopping"), "description": _("View your shopping lists"), "url": + "./list/shopping-list/"}], "share_target": {"action": "/data/import/url", "method": "GET", "params": {"title": "title", "url": "url", "text": "text"}} } return JsonResponse(manifest_info, json_dumps_params={'indent': 4})