mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 01:06:11 -06:00
12237 fix tobytes
This commit is contained in:
parent
46bfc5adec
commit
c997411fb3
@ -290,7 +290,7 @@ class DataFile(models.Model):
|
||||
@property
|
||||
def data_as_string(self):
|
||||
try:
|
||||
return self.data.tobytes().decode('utf-8')
|
||||
return bytes(self.data, 'utf-8')
|
||||
except UnicodeDecodeError:
|
||||
return None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user