Fix server error from PATCH to inventory source (#16274)

Fix server error from PATCH to inventory source, co-authored with Claude opus 4.6
This commit is contained in:
Alan Rominger
2026-02-11 15:10:32 -05:00
committed by GitHub
parent 707f2fa5da
commit f2438a0e86
3 changed files with 70 additions and 1 deletions

View File

@@ -89,7 +89,7 @@ class DeprecatedCredentialField(serializers.IntegerField):
def to_internal_value(self, pk):
try:
pk = int(pk)
except ValueError:
except (ValueError, TypeError):
self.fail('invalid')
try:
Credential.objects.get(pk=pk)