Преглед изворни кода

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

Jeremy Stretch пре 2 година
родитељ
комит
296166da95
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      netbox/core/models/data.py

+ 1 - 1
netbox/core/models/data.py

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