1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #13656: Correct decoding of BinaryField content for Django 4.2

This commit is contained in:
Jeremy Stretch
2023-09-01 10:07:11 -04:00
parent 679cc8fdda
commit 296166da95

View File

@ -316,7 +316,7 @@ class DataFile(models.Model):
if not self.data:
return None
try:
return bytes(self.data, 'utf-8')
return self.data.decode('utf-8')
except UnicodeDecodeError:
return None