Pārlūkot izejas kodu

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

Jeremy Stretch 2 gadi atpakaļ
vecāks
revīzija
296166da95
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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:
             return None
         try:
-            return bytes(self.data, 'utf-8')
+            return self.data.decode('utf-8')
         except UnicodeDecodeError:
             return None