From c197358ce4e120023a2963b521ac5446abd175c2 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 20 Aug 2024 00:06:13 +0200 Subject: [PATCH] small perf imrpovements --- .pre-commit-config.yaml | 1 + src/backend/InvenTree/plugin/base/integration/ScheduleMixin.py | 2 +- src/backend/InvenTree/stock/test_migrations.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 42ec1e692a..c4876f5773 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,6 +24,7 @@ repos: - id: ruff args: [ --fix, + --unsafe-fixes, --preview ] - repo: https://github.com/astral-sh/uv-pre-commit diff --git a/src/backend/InvenTree/plugin/base/integration/ScheduleMixin.py b/src/backend/InvenTree/plugin/base/integration/ScheduleMixin.py index 8f2b780781..c61e907e9c 100644 --- a/src/backend/InvenTree/plugin/base/integration/ScheduleMixin.py +++ b/src/backend/InvenTree/plugin/base/integration/ScheduleMixin.py @@ -200,7 +200,7 @@ class ScheduleMixin: try: from django_q.models import Schedule - for key, _ in self.scheduled_tasks.items(): + for key in self.scheduled_tasks: task_name = self.get_task_name(key) try: diff --git a/src/backend/InvenTree/stock/test_migrations.py b/src/backend/InvenTree/stock/test_migrations.py index 05d320b588..11810869f4 100644 --- a/src/backend/InvenTree/stock/test_migrations.py +++ b/src/backend/InvenTree/stock/test_migrations.py @@ -200,7 +200,7 @@ class TestTestResultMigration(MigratorTestCase): ) # Create some test results - for _k, v in self.test_keys.items(): + for v in self.test_keys.values(): StockItemTestResult.objects.create( stock_item=si, test=v, result=True, value=f'Result: {ii} : {jj}' )