Merge branch 'mealie-next' into feat-frontend-access-controll

This commit is contained in:
Kuchenpirat 2024-02-02 17:27:58 +01:00 committed by GitHub
commit a04b6983e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 101 additions and 92 deletions

View File

@ -59,7 +59,12 @@ def _resolve_duplicate_food(
keep_food_id: UUID4,
dupe_food_id: UUID4,
):
for shopping_list_item in session.query(ShoppingListItem).filter_by(food_id=dupe_food_id).all():
for shopping_list_item in (
session.query(ShoppingListItem)
.options(load_only(ShoppingListItem.id, ShoppingListItem.food_id))
.filter_by(food_id=dupe_food_id)
.all()
):
shopping_list_item.food_id = keep_food_id
for recipe_ingredient in (
@ -82,10 +87,20 @@ def _resolve_duplicate_unit(
keep_unit_id: UUID4,
dupe_unit_id: UUID4,
):
for shopping_list_item in session.query(ShoppingListItem).filter_by(unit_id=dupe_unit_id).all():
for shopping_list_item in (
session.query(ShoppingListItem)
.options(load_only(ShoppingListItem.id, ShoppingListItem.unit_id))
.filter_by(unit_id=dupe_unit_id)
.all()
):
shopping_list_item.unit_id = keep_unit_id
for recipe_ingredient in session.query(RecipeIngredientModel).filter_by(unit_id=dupe_unit_id).all():
for recipe_ingredient in (
session.query(RecipeIngredientModel)
.options(load_only(RecipeIngredientModel.id, RecipeIngredientModel.unit_id))
.filter_by(unit_id=dupe_unit_id)
.all()
):
recipe_ingredient.unit_id = keep_unit_id
session.commit()
@ -100,10 +115,20 @@ def _resolve_duplicate_label(
keep_label_id: UUID4,
dupe_label_id: UUID4,
):
for shopping_list_item in session.query(ShoppingListItem).filter_by(label_id=dupe_label_id).all():
for shopping_list_item in (
session.query(ShoppingListItem)
.options(load_only(ShoppingListItem.id, ShoppingListItem.label_id))
.filter_by(label_id=dupe_label_id)
.all()
):
shopping_list_item.label_id = keep_label_id
for ingredient_food in session.query(IngredientFoodModel).filter_by(label_id=dupe_label_id).all():
for ingredient_food in (
session.query(IngredientFoodModel)
.options(load_only(IngredientFoodModel.id, IngredientFoodModel.label_id))
.filter_by(label_id=dupe_label_id)
.all()
):
ingredient_food.label_id = keep_label_id
session.commit()

View File

@ -121,7 +121,7 @@
</template>
<template v-else-if="property.slot === 'build'">
<v-list-item-subtitle>
<a target="_blank" :href="`https://github.com/hay-kot/mealie/commit/${property.value}`">
<a target="_blank" :href="`https://github.com/mealie-recipes/mealie/commit/${property.value}`">
{{ property.value }}
</a>
</v-list-item-subtitle>

View File

@ -1,21 +0,0 @@
<template>
<div></div>
</template>
<script lang="ts">
import { defineComponent } from "@nuxtjs/composition-api";
export default defineComponent({
setup() {
return {};
},
head() {
return {
title: this.$t("settings.profile") as string,
};
},
});
</script>
<style scoped>
</style>

View File

@ -35,32 +35,32 @@
"butter": "tereyağı",
"butternut-pumpkin": "butternut pumpkin",
"butternut-squash": "butternut squash",
"cactus-edible": "cactus, edible",
"cactus-edible": "yenilebilir kaktüs",
"calabrese": "calabrese",
"cannabis": "kenevir",
"capsicum": "capsicum",
"caraway": "caraway",
"capsicum": "kırmızı biber",
"caraway": "kimyon",
"carrot": "havuç",
"castor-sugar": "castor sugar",
"cayenne-pepper": "cayenne pepper",
"cayenne-pepper": "kırmızı biber",
"celeriac": "kereviz",
"celery": "kereviz",
"cereal-grains": "cereal grains",
"rice": "pirinç",
"chard": "chard",
"chard": "pazı",
"cheese": "peynir",
"chicory": "chicory",
"chilli-peppers": "chilli peppers",
"chives": "chives",
"chicory": "hindiba",
"chilli-peppers": "acı biber",
"chives": "frenk soğanı",
"chocolate": "çikolata",
"cilantro": "cilantro",
"cilantro": "kişniş",
"cinnamon": "tarçın",
"clarified-butter": "clarified butter",
"clarified-butter": "sade yağ",
"coconut": "hindistan cevizi",
"coconut-milk": "coconut milk",
"coconut-milk": "hindistan cevizi sütü",
"coffee": "kahve",
"confectioners-sugar": "confectioners' sugar",
"coriander": "coriander",
"confectioners-sugar": "pudra şekeri",
"coriander": "kişniş",
"corn": "mısır",
"corn-syrup": "mısır şurubu",
"cottonseed-oil": "cottonseed oil",
@ -68,7 +68,7 @@
"cream-of-tartar": "cream of tartar",
"cucumber": "salatalık",
"cumin": "kimyon",
"daikon": "daikon",
"daikon": "beyaz turp",
"dairy-products-and-dairy-substitutes": "süt ürünleri ve süt yerine geçen ürünler",
"eggs": "yumurta",
"ghee": "ghee",
@ -92,7 +92,7 @@
"stockfish": "stockfish",
"trout": "alabalık",
"tuna": "ton balığı",
"five-spice-powder": "five spice powder",
"five-spice-powder": "beşli baharat",
"flour": "un",
"frisee": "frisee",
"fructose": "fruktoz",
@ -109,7 +109,7 @@
"giblets": "giblets",
"grains": "tahıllar",
"maize": "maize",
"sweetcorn": "sweetcorn",
"sweetcorn": "tatlı mısır",
"teff": "teff",
"grape-seed-oil": "üzüm çekirdeği yağı",
"green-onion": "taze soğan",
@ -131,17 +131,17 @@
"kumara": "kumara",
"leavening-agents": "leavening agents",
"leek": "leek",
"legumes": "legumes ",
"peas": "peas",
"beans": "beans",
"lentils": "lentils",
"lemongrass": "lemongrass",
"lettuce": "lettuce",
"liver": "liver",
"maple-syrup": "maple syrup",
"meat": "meat",
"legumes": "baklagiller ",
"peas": "bezelye",
"beans": "fasulye",
"lentils": "mercimek",
"lemongrass": "limon otu",
"lettuce": "marul",
"liver": "karaciğer",
"maple-syrup": "akçaağaç şurubu",
"meat": "et",
"mortadella": "mortadella",
"mushroom": "mushroom",
"mushroom": "mantar",
"white-mushroom": "white mushroom",
"mussels": "mussels",
"nori": "nori",
@ -150,44 +150,44 @@
"nuts": "nuts",
"nanaimo-bar-mix": "nanaimo bar mix",
"octopuses": "octopuses",
"oils": "oils",
"oils": "yağ",
"olive-oil": "zeytin yağı",
"okra": "okra",
"okra": "bamya",
"olive": "zeytin",
"onion-family": "onion family",
"onion": "soğan",
"scallion": "scallion",
"shallot": "shallot",
"spring-onion": "spring onion",
"scallion": "taze soğan",
"shallot": "arpacık soğan",
"spring-onion": "yeşil soğan",
"orange-blossom-water": "orange blossom water",
"oysters": "istiridye",
"panch-puran": "panch puran",
"paprika": "kırmızı biber",
"parsnip": "parsnip",
"parsnip": "yaban havucu",
"pepper": "biber",
"peppers": "biber",
"plantain": "plantain",
"pineapple": "ananas",
"poppy-seeds": "poppy seeds",
"poppy-seeds": "haşhaş tohumu",
"potatoes": "patates",
"poultry": "kümes hayvanları",
"powdered-sugar": "powdered sugar",
"powdered-sugar": "pudra şekeri",
"pumpkin": "balkabağı",
"pumpkin-seeds": "kabak çekirdeği",
"radish": "turp",
"raw-sugar": "kesme şeker",
"refined-sugar": "refined sugar",
"refined-sugar": "rafine şeker",
"rice-flour": "pirinç unu",
"rock-sugar": "rock sugar",
"rock-sugar": "kide şekeri",
"rum": "rom",
"salt": "tuz",
"seafood": "deniz ürünleri",
"seeds": "tohumlar",
"sesame-seeds": "sesame seeds",
"sesame-seeds": "susam",
"sunflower-seeds": "ay çekirdeği",
"soda": "soda",
"soda-baking": "soda, baking",
"soybean": "soybean",
"soda-baking": "karbonat",
"soybean": "soya fasulyesi",
"spaghetti-squash": "spaghetti squash",
"spices": "baharatlar",
"spinach": "ıspanak",

View File

@ -41,15 +41,15 @@ class Message:
msg["From"] = f"{self.mail_from_name} <{self.mail_from_address}>"
msg["To"] = to
msg["Date"] = formatdate(localtime=True)
msg.add_alternative(self.html, subtype="html")
msg.add_alternative(html2text(self.html), subtype="plain")
msg.add_alternative(self.html, subtype="html")
try:
message_id = f"{uuid4()}@{self.mail_from_address.split('@')[1]}"
message_id = f"<{uuid4()}@{self.mail_from_address.split('@')[1]}>"
except IndexError:
# this should never happen with a valid email address,
# but we let the SMTP server handle it instead of raising it here
message_id = f"{uuid4()}@{self.mail_from_address}"
message_id = f"<{uuid4()}@{self.mail_from_address}>"
msg["Message-ID"] = message_id
msg["MIME-Version"] = "1.0"

44
poetry.lock generated
View File

@ -1979,13 +1979,13 @@ dev = ["atomicwrites (==1.2.1)", "attrs (==19.2.0)", "coverage (==6.5.0)", "hatc
[[package]]
name = "python-slugify"
version = "8.0.2"
version = "8.0.3"
description = "A Python slugify application that also handles Unicode"
optional = false
python-versions = ">=3.7"
files = [
{file = "python-slugify-8.0.2.tar.gz", hash = "sha256:a1a02b127a95c124fd84f8f88be730e557fd823774bf19b1cd5e8704e2ae0e5e"},
{file = "python_slugify-8.0.2-py2.py3-none-any.whl", hash = "sha256:428ea9b00c977b8f6c097724398f190b2c18e2a6011094d1001285875ccacdbf"},
{file = "python-slugify-8.0.3.tar.gz", hash = "sha256:e04cba5f1c562502a1175c84a8bc23890c54cdaf23fccaaf0bf78511508cabed"},
{file = "python_slugify-8.0.3-py2.py3-none-any.whl", hash = "sha256:c71189c161e8c671f1b141034d9a56308a8a5978cd13d40446c879569212fdd1"},
]
[package.dependencies]
@ -2381,28 +2381,28 @@ pyasn1 = ">=0.1.3"
[[package]]
name = "ruff"
version = "0.1.15"
version = "0.2.0"
description = "An extremely fast Python linter and code formatter, written in Rust."
optional = false
python-versions = ">=3.7"
files = [
{file = "ruff-0.1.15-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:5fe8d54df166ecc24106db7dd6a68d44852d14eb0729ea4672bb4d96c320b7df"},
{file = "ruff-0.1.15-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6f0bfbb53c4b4de117ac4d6ddfd33aa5fc31beeaa21d23c45c6dd249faf9126f"},
{file = "ruff-0.1.15-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e0d432aec35bfc0d800d4f70eba26e23a352386be3a6cf157083d18f6f5881c8"},
{file = "ruff-0.1.15-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9405fa9ac0e97f35aaddf185a1be194a589424b8713e3b97b762336ec79ff807"},
{file = "ruff-0.1.15-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c66ec24fe36841636e814b8f90f572a8c0cb0e54d8b5c2d0e300d28a0d7bffec"},
{file = "ruff-0.1.15-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:6f8ad828f01e8dd32cc58bc28375150171d198491fc901f6f98d2a39ba8e3ff5"},
{file = "ruff-0.1.15-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86811954eec63e9ea162af0ffa9f8d09088bab51b7438e8b6488b9401863c25e"},
{file = "ruff-0.1.15-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fd4025ac5e87d9b80e1f300207eb2fd099ff8200fa2320d7dc066a3f4622dc6b"},
{file = "ruff-0.1.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b17b93c02cdb6aeb696effecea1095ac93f3884a49a554a9afa76bb125c114c1"},
{file = "ruff-0.1.15-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ddb87643be40f034e97e97f5bc2ef7ce39de20e34608f3f829db727a93fb82c5"},
{file = "ruff-0.1.15-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:abf4822129ed3a5ce54383d5f0e964e7fef74a41e48eb1dfad404151efc130a2"},
{file = "ruff-0.1.15-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6c629cf64bacfd136c07c78ac10a54578ec9d1bd2a9d395efbee0935868bf852"},
{file = "ruff-0.1.15-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1bab866aafb53da39c2cadfb8e1c4550ac5340bb40300083eb8967ba25481447"},
{file = "ruff-0.1.15-py3-none-win32.whl", hash = "sha256:2417e1cb6e2068389b07e6fa74c306b2810fe3ee3476d5b8a96616633f40d14f"},
{file = "ruff-0.1.15-py3-none-win_amd64.whl", hash = "sha256:3837ac73d869efc4182d9036b1405ef4c73d9b1f88da2413875e34e0d6919587"},
{file = "ruff-0.1.15-py3-none-win_arm64.whl", hash = "sha256:9a933dfb1c14ec7a33cceb1e49ec4a16b51ce3c20fd42663198746efc0427360"},
{file = "ruff-0.1.15.tar.gz", hash = "sha256:f6dfa8c1b21c913c326919056c390966648b680966febcb796cc9d1aaab8564e"},
{file = "ruff-0.2.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:638ea3294f800d18bae84a492cb5a245c8d29c90d19a91d8e338937a4c27fca0"},
{file = "ruff-0.2.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3ff35433fcf4dff6d610738712152df6b7d92351a1bde8e00bd405b08b3d5759"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf9faafbdcf4f53917019f2c230766da437d4fd5caecd12ddb68bb6a17d74399"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8153a3e4128ed770871c47545f1ae7b055023e0c222ff72a759f5a341ee06483"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e8a75a98ae989a27090e9c51f763990ad5bbc92d20626d54e9701c7fe597f399"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:87057dd2fdde297130ff99553be8549ca38a2965871462a97394c22ed2dfc19d"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6d232f99d3ab00094ebaf88e0fb7a8ccacaa54cc7fa3b8993d9627a11e6aed7a"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d3c641f95f435fc6754b05591774a17df41648f0daf3de0d75ad3d9f099ab92"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3826fb34c144ef1e171b323ed6ae9146ab76d109960addca730756dc19dc7b22"},
{file = "ruff-0.2.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:eceab7d85d09321b4de18b62d38710cf296cb49e98979960a59c6b9307c18cfe"},
{file = "ruff-0.2.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:30ad74687e1f4a9ff8e513b20b82ccadb6bd796fe5697f1e417189c5cde6be3e"},
{file = "ruff-0.2.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a7e3818698f8460bd0f8d4322bbe99db8327e9bc2c93c789d3159f5b335f47da"},
{file = "ruff-0.2.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:edf23041242c48b0d8295214783ef543847ef29e8226d9f69bf96592dba82a83"},
{file = "ruff-0.2.0-py3-none-win32.whl", hash = "sha256:e155147199c2714ff52385b760fe242bb99ea64b240a9ffbd6a5918eb1268843"},
{file = "ruff-0.2.0-py3-none-win_amd64.whl", hash = "sha256:ba918e01cdd21e81b07555564f40d307b0caafa9a7a65742e98ff244f5035c59"},
{file = "ruff-0.2.0-py3-none-win_arm64.whl", hash = "sha256:3fbaff1ba9564a2c5943f8f38bc221f04bac687cc7485e45237579fee7ccda79"},
{file = "ruff-0.2.0.tar.gz", hash = "sha256:63856b91837606c673537d2889989733d7dffde553828d3b0f0bacfa6def54be"},
]
[[package]]
@ -2944,4 +2944,4 @@ pgsql = ["psycopg2-binary"]
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "e1ca2b8f820621470f312ce0d6b965d9ecfa102bbf09a029b93539500b29e2c1"
content-hash = "c2661139d3db69f05aafff6539ecf5be5b90a9e3316c11015be37dbb391c6dbf"

View File

@ -61,7 +61,7 @@ pylint = "^3.0.0"
pytest = "^7.2.0"
pytest-asyncio = "^0.23.0"
rich = "^13.5.2"
ruff = "^0.1.0"
ruff = "^0.2.0"
types-PyYAML = "^6.0.4"
types-python-dateutil = "^2.8.18"
types-python-slugify = "^6.0.0"

View File

@ -13,6 +13,9 @@ backup_version_44e8d670719d_2 = CWD / "backups/backup_version_44e8d670719d_2.zip
backup_version_44e8d670719d_3 = CWD / "backups/backup_version_44e8d670719d_3.zip"
"""44e8d670719d: add extras to shopping lists, list items, and ingredient foods"""
backup_version_44e8d670719d_4 = CWD / "backups/backup_version_44e8d670719d_4.zip"
"""44e8d670719d: add extras to shopping lists, list items, and ingredient foods"""
backup_version_ba1e4a6cfe99_1 = CWD / "backups/backup_version_ba1e4a6cfe99_1.zip"
"""ba1e4a6cfe99: added plural names and alias tables for foods and units"""

Binary file not shown.

View File

@ -74,6 +74,7 @@ def test_database_restore():
test_data.backup_version_44e8d670719d_1,
test_data.backup_version_44e8d670719d_2,
test_data.backup_version_44e8d670719d_3,
test_data.backup_version_44e8d670719d_4,
test_data.backup_version_ba1e4a6cfe99_1,
test_data.backup_version_bcfdad6b7355_1,
],
@ -81,6 +82,7 @@ def test_database_restore():
"44e8d670719d_1: add extras to shopping lists, list items, and ingredient foods",
"44e8d670719d_2: add extras to shopping lists, list items, and ingredient foods",
"44e8d670719d_3: add extras to shopping lists, list items, and ingredient foods",
"44e8d670719d_4: add extras to shopping lists, list items, and ingredient foods",
"ba1e4a6cfe99_1: added plural names and alias tables for foods and units",
"bcfdad6b7355_1: remove tool name and slug unique contraints",
],