Merge branch 'develop' of https://github.com/vabene1111/recipes into develop

This commit is contained in:
vabene1111
2022-08-01 16:18:46 +02:00
5 changed files with 17 additions and 9 deletions

View File

@@ -24,7 +24,7 @@ class CopyMeThat(Integration):
try:
source = file.find("a", {"id": "original_link"}).text
except AttributeError:
source = ''
source = None
recipe = Recipe.objects.create(name=file.find("div", {"id": "name"}).text.strip()[:128], source_url=source, created_by=self.request.user, internal=True, space=self.request.space, )
@@ -58,10 +58,10 @@ class CopyMeThat(Integration):
ingredients = file.find("ul", {"id": "recipeIngredients"})
if isinstance(ingredients, Tag):
for ingredient in ingredients.children:
if not isinstance(ingredient, Tag) or ingredient.text == "":
if not isinstance(ingredient, Tag) or not ingredient.text.strip() or "recipeIngredient_spacer" in ingredient['class']:
continue
if any(x in ingredient['class'] for x in ["recipeIngredient_subheader", "recipeIngredient_note"]):
step.ingredients.add(Ingredient.objects.create(is_header=True, note=ingredient.text.strip(), original_text=ingredient.text.strip(), space=self.request.space, ))
step.ingredients.add(Ingredient.objects.create(is_header=True, note=ingredient.text.strip()[:256], original_text=ingredient.text.strip(), space=self.request.space, ))
else:
amount, unit, food, note = ingredient_parser.parse(ingredient.text.strip())
f = ingredient_parser.get_food(food)

View File

@@ -28,7 +28,7 @@ Jinja2==3.1.2
django-webpack-loader==1.5.0
git+https://github.com/ierror/django-js-reverse@7cab78c4531780ab4b32033d5104ccd5be1a246a
django-allauth==0.51.0
recipe-scrapers==14.6.0
recipe-scrapers==14.11.0
django-scopes==1.2.0.post1
pytest==7.1.2
pytest-django==4.5.2

View File

@@ -375,5 +375,11 @@
"Documentation": "Documentation",
"New_Supermarket": "Créer un nouveau supermarché",
"New_Supermarket_Category": "Créer une nouvelle catégorie de supermarché",
"and_down": "& Dessous"
"and_down": "& Dessous",
"recipe_filter": "Filtrer les recettes",
"no_more_images_found": "Pas d'images supplémentaires trouvées sur le site.",
"sql_debug": "Débogage de la base SQL",
"last_cooked": "Dernière recette utilisée",
"times_cooked": "Temps de cuisson",
"show_sortby": "Trier par"
}

View File

@@ -425,5 +425,7 @@
"Message": "Wiadomość",
"reset_food_inheritance": "Zresetuj dziedziczenie",
"reset_food_inheritance_info": "Zresetuj wszystkie produkty spożywcze do domyślnych dziedziczonych pól i ich wartości nadrzędnych.",
"Valid Until": "Ważne do"
"Valid Until": "Ważne do",
"show_ingredient_overview": "Wyświetl listę wszystkich składników na początku przepisu.",
"Ingredient Overview": "Przegląd składników"
}

View File

@@ -10508,9 +10508,9 @@ terser-webpack-plugin@^5.1.1, terser-webpack-plugin@^5.1.3:
terser "^5.7.2"
terser@^4.1.2, terser@^4.6.2:
version "4.8.0"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17"
integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==
version "4.8.1"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f"
integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==
dependencies:
commander "^2.20.0"
source-map "~0.6.1"