variables: don't treat invalid json as formatted values (#26703)
This commit is contained in:
parent
b08256374d
commit
fab9a4f56f
|
@ -39,7 +39,10 @@ class Variable(models.Model):
|
|||
@property
|
||||
def json(self):
|
||||
if self.value and (self.value[0] in '{[' or self.value in ('true', 'false')):
|
||||
return json.loads(self.value)
|
||||
try:
|
||||
return json.loads(self.value)
|
||||
except ValueError:
|
||||
pass
|
||||
return self.value
|
||||
|
||||
def clean(self):
|
||||
|
|
Loading…
Reference in New Issue