From 4c45716843e1401d3c0aa0d2bce39f35e3c27166 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 16:31:59 +1100 Subject: [PATCH 1/3] chore(deps): bump actions/setup-python in the dependencies group (#10940) Bumps the dependencies group with 1 update: [actions/setup-python](https://github.com/actions/setup-python). Updates `actions/setup-python` from 6.0.0 to 6.1.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/e797f83bcb11b83ae66e0230d6156d7c80228e7c...83679a892e2d95755f2dac6acb0bfd1e9ac5d548) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.yaml | 2 +- .github/workflows/qc_checks.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 9e839da766..4609adf56c 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -157,7 +157,7 @@ jobs: with: persist-credentials: false - name: Set Up Python ${{ env.python_version }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # pin@v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # pin@v6.1.0 with: python-version: ${{ env.python_version }} - name: Version Check diff --git a/.github/workflows/qc_checks.yaml b/.github/workflows/qc_checks.yaml index c1b1dd0db4..5a0416c508 100644 --- a/.github/workflows/qc_checks.yaml +++ b/.github/workflows/qc_checks.yaml @@ -86,7 +86,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.python_version }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # pin@v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # pin@v6.1.0 with: python-version: ${{ env.python_version }} cache: "pip" @@ -130,7 +130,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.python_version }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # pin@v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # pin@v6.1.0 with: python-version: ${{ env.python_version }} - name: Check Config From 38b27271acb3cb05c9ed002e20d25967c1a4dfce Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 2 Dec 2025 17:21:24 +1100 Subject: [PATCH 2/3] [bug] Handle TransactionManagementError (#10942) In the case where we try to call refresh_from_db within an atomic transaction block, it will throw a TransactionManagementError --- src/backend/InvenTree/InvenTree/models.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/backend/InvenTree/InvenTree/models.py b/src/backend/InvenTree/InvenTree/models.py index c6f61b3ca3..71bf510871 100644 --- a/src/backend/InvenTree/InvenTree/models.py +++ b/src/backend/InvenTree/InvenTree/models.py @@ -10,6 +10,7 @@ from django.core.exceptions import ValidationError from django.db import models from django.db.models import QuerySet from django.db.models.signals import post_save +from django.db.transaction import TransactionManagementError from django.dispatch import receiver from django.urls import resolve, reverse from django.urls.exceptions import NoReverseMatch @@ -763,7 +764,15 @@ class InvenTreeTree(MPTTModel): if len(trees) > 0: # A tree update was performed, so we need to refresh the instance - self.refresh_from_db() + try: + self.refresh_from_db() + except TransactionManagementError: + # If we are inside a transaction block, we cannot refresh from db + pass + except Exception as e: + # Any other error is unexpected + InvenTree.sentry.report_exception(e) + InvenTree.exceptions.log_error(f'{self.__class__.__name__}.save') def partial_rebuild(self, tree_id: int) -> bool: """Perform a partial rebuild of the tree structure. From c8b1bfb71652857c5fe36db26b5ef944e1111b00 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 2 Dec 2025 07:11:02 +0000 Subject: [PATCH 3/3] refactor (frontend): address code scanning issues (#10935) * remove unused defs * optimize * revert rename --- src/frontend/src/components/buttons/PrintingActions.tsx | 4 ++-- src/frontend/src/hooks/UseDataExport.tsx | 2 +- src/frontend/src/hooks/UseDataOutput.tsx | 2 +- src/frontend/src/hooks/UseImportSession.tsx | 2 +- src/frontend/src/pages/sales/SalesOrderShipmentDetail.tsx | 6 +----- src/frontend/src/tables/machine/MachineTypeTable.tsx | 4 +--- 6 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/frontend/src/components/buttons/PrintingActions.tsx b/src/frontend/src/components/buttons/PrintingActions.tsx index dad818e96f..4dbb997af9 100644 --- a/src/frontend/src/components/buttons/PrintingActions.tsx +++ b/src/frontend/src/components/buttons/PrintingActions.tsx @@ -52,12 +52,12 @@ export function PrintingActions({ const [labelId, setLabelId] = useState(undefined); const [reportId, setReportId] = useState(undefined); - const labelProgress = useDataOutput({ + useDataOutput({ title: t`Printing Labels`, id: labelId }); - const reportProgress = useDataOutput({ + useDataOutput({ title: t`Printing Reports`, id: reportId }); diff --git a/src/frontend/src/hooks/UseDataExport.tsx b/src/frontend/src/hooks/UseDataExport.tsx index 653a79beb3..8237f326e8 100644 --- a/src/frontend/src/hooks/UseDataExport.tsx +++ b/src/frontend/src/hooks/UseDataExport.tsx @@ -30,7 +30,7 @@ export default function useDataExport({ const [exportId, setExportId] = useState(undefined); - const progress = useDataOutput({ + useDataOutput({ title: t`Exporting Data`, id: exportId }); diff --git a/src/frontend/src/hooks/UseDataOutput.tsx b/src/frontend/src/hooks/UseDataOutput.tsx index 7844e899c0..84be903f70 100644 --- a/src/frontend/src/hooks/UseDataOutput.tsx +++ b/src/frontend/src/hooks/UseDataOutput.tsx @@ -40,7 +40,7 @@ export default function useDataOutput({ } else setLoading(false); }, [id, title]); - const progress = useQuery({ + useQuery({ enabled: !!id && loading && visibility === 'visible', refetchInterval: 500, queryKey: ['data-output', id, title], diff --git a/src/frontend/src/hooks/UseImportSession.tsx b/src/frontend/src/hooks/UseImportSession.tsx index 7503228c03..5410e77ee7 100644 --- a/src/frontend/src/hooks/UseImportSession.tsx +++ b/src/frontend/src/hooks/UseImportSession.tsx @@ -49,7 +49,7 @@ export function useImportSession({ setInstance(data); }, []); - const importSessionStatus = useStatusCodes({ + useStatusCodes({ modelType: ModelType.importsession }); diff --git a/src/frontend/src/pages/sales/SalesOrderShipmentDetail.tsx b/src/frontend/src/pages/sales/SalesOrderShipmentDetail.tsx index 153933dac9..2a0954ea42 100644 --- a/src/frontend/src/pages/sales/SalesOrderShipmentDetail.tsx +++ b/src/frontend/src/pages/sales/SalesOrderShipmentDetail.tsx @@ -72,11 +72,7 @@ export default function SalesOrderShipmentDetail() { } }); - const { - instance: customer, - instanceQuery: customerQuery, - refreshInstance: refreshCustomer - } = useInstance({ + const { instance: customer, instanceQuery: customerQuery } = useInstance({ endpoint: ApiEndpoints.company_list, pk: shipment.order_detail?.customer, hasPrimaryKey: true diff --git a/src/frontend/src/tables/machine/MachineTypeTable.tsx b/src/frontend/src/tables/machine/MachineTypeTable.tsx index f7496da4d7..c9aebc29e8 100644 --- a/src/frontend/src/tables/machine/MachineTypeTable.tsx +++ b/src/frontend/src/tables/machine/MachineTypeTable.tsx @@ -103,9 +103,7 @@ export function MachineDriverTable({ function MachineTypeDrawer({ machineTypeSlug }: Readonly<{ machineTypeSlug: string }>) { - const navigate = useNavigate(); - - const { machineTypes, refresh, isFetching } = useMachineTypeDriver({ + const { machineTypes, isFetching } = useMachineTypeDriver({ includeDrivers: false }); const machineType = useMemo(