From ac033600e951c2c94aa2a63e225ca6a631fe1ec3 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Mon, 12 May 2025 20:26:12 +0200 Subject: [PATCH] fixed regex warning --- cookbook/views/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/views/api.py b/cookbook/views/api.py index 369b23844..a8b2b902a 100644 --- a/cookbook/views/api.py +++ b/cookbook/views/api.py @@ -1724,7 +1724,7 @@ class RecipeUrlImportView(APIView): return Response(RecipeFromSourceResponseSerializer(context={'request': request}).to_representation(response), status=status.HTTP_200_OK) tandoor_url = None - if re.match('^(.)*/recipe/[0-9]+/\?share=[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$', url): + if re.match('^(.)*/recipe/[0-9]+/?share=[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$', url): tandoor_url = url.replace('/recipe/', '/api/recipe/') elif re.match('^(.)*/view/recipe/[0-9]+/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$', url): tandoor_url = (url.replace('/view/recipe/', '/api/recipe/').replace(re.split('/recipe/[0-9]+', url)[1], '') + '?share=' +