[PR #5578] [MERGED] Report inconsistent values when migrating custom field data #13038

Closed
opened 2025-12-29 22:25:05 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/5578
Author: @candlerb
Created: 1/5/2021
Status: Merged
Merged: 1/5/2021
Merged by: @jeremystretch

Base: developHead: candlerb-5573


📝 Commits (1)

  • 359ae5d Raise exceptions for other inconsistencies when migrating custom field data

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 netbox/extras/migrations/0051_migrate_customfields.py (+1 -1)

📄 Description

Fixes: #5573

During migration, if a customfieldvalue references a non-existent object, it bombs out with:

TypeError: 'NoneType' object is not subscriptable

but gives no indication of what data item caused the error.

With this change, the exception still occurs, but the offending data item is printed first (as was already the case for ValueError only).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/5578 **Author:** [@candlerb](https://github.com/candlerb) **Created:** 1/5/2021 **Status:** ✅ Merged **Merged:** 1/5/2021 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `candlerb-5573` --- ### 📝 Commits (1) - [`359ae5d`](https://github.com/netbox-community/netbox/commit/359ae5d116f983039b87b4b694b822116a32e652) Raise exceptions for other inconsistencies when migrating custom field data ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/migrations/0051_migrate_customfields.py` (+1 -1) </details> ### 📄 Description ### Fixes: #5573 During migration, if a customfieldvalue references a non-existent object, it bombs out with: ``` TypeError: 'NoneType' object is not subscriptable ``` but gives no indication of what data item caused the error. With this change, the exception still occurs, but the offending data item is printed first (as was already the case for `ValueError` only). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:25:05 +01:00
adam closed this issue 2025-12-29 22:25:05 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13038