1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-06 22:15:22 +02:00

fix: Lint Python code with ruff (#3799)

This commit is contained in:
Christian Clauss 2024-08-12 17:09:30 +02:00 committed by GitHub
parent 65ece35966
commit 432914e310
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 112 additions and 120 deletions

View file

@ -6,9 +6,6 @@ Create Date: 2023-02-10 21:18:32.405130
"""
import sqlalchemy as sa
import mealie.db.migration_types
from alembic import op
# revision identifiers, used by Alembic.

View file

@ -11,7 +11,6 @@ from sqlalchemy import orm, select
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
from text_unidecode import unidecode
import mealie.db.migration_types
from alembic import op
from mealie.db.models._model_utils.guid import GUID

View file

@ -8,7 +8,6 @@ Create Date: 2023-02-22 21:45:52.900964
import sqlalchemy as sa
import mealie.db.migration_types
from alembic import op
# revision identifiers, used by Alembic.

View file

@ -6,12 +6,7 @@ Create Date: 2023-04-13 06:47:04.617131
"""
import sqlalchemy as sa
import mealie.db.migration_types
from alembic import op
import alembic.context as context
from mealie.core.config import get_app_settings
# revision identifiers, used by Alembic.
revision = "b3dbb554ba53"

View file

@ -66,7 +66,7 @@ def populate_shopping_list_users():
user_id = find_user_id_for_group(group_id)
if user_id:
session.execute(
sa.text(f"UPDATE shopping_lists SET user_id=:user_id WHERE id=:id").bindparams(
sa.text("UPDATE shopping_lists SET user_id=:user_id WHERE id=:id").bindparams(
user_id=user_id, id=list_id
)
)
@ -74,7 +74,7 @@ def populate_shopping_list_users():
logger.warning(
f"No user found for shopping list {list_id} with group {group_id}; deleting shopping list"
)
session.execute(sa.text(f"DELETE FROM shopping_lists WHERE id=:id").bindparams(id=list_id))
session.execute(sa.text("DELETE FROM shopping_lists WHERE id=:id").bindparams(id=list_id))
def upgrade():

View file

@ -6,9 +6,6 @@ Create Date: 2024-03-10 05:08:32.397027
"""
import sqlalchemy as sa
import mealie.db.migration_types
from alembic import op
# revision identifiers, used by Alembic.

View file

@ -32,7 +32,7 @@ def new_user_rating(user_id: Any, recipe_id: Any, rating: float | None = None, i
if is_postgres():
id = str(uuid4())
else:
id = "%.32x" % uuid4().int
id = "%.32x" % uuid4().int # noqa: UP031
now = datetime.now(timezone.utc).isoformat()
return {