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