aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-01-04 11:29:00 -0500
committerParker Berberian <pberberian@iol.unh.edu>2019-01-04 11:29:00 -0500
commitb4d05381c10b806924a7e56501feb2c64fc1a443 (patch)
treeb789dfbcef09fe265cb52ec9c8ad3d8a2807360e
parentd9fe97928dbe3e3cd8988093e9547d8a01813e6e (diff)
Fix API serialization
Under special circumstances, the 'context' field may be empty and serialization will fail, but that field is optional so we will ignore errors. Change-Id: I2e1e47a2f7d507e45b171f80aa241c8026cfc1a5 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
-rw-r--r--src/api/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/api/models.py b/src/api/models.py
index cc25f82..a1fedfe 100644
--- a/src/api/models.py
+++ b/src/api/models.py
@@ -350,7 +350,10 @@ class AccessConfig(TaskConfig):
d['access_type'] = self.access_type
d['user'] = self.user.id
d['revoke'] = self.revoke
- d['context'] = json.loads(self.context)
+ try:
+ d['context'] = json.loads(self.context)
+ except:
+ pass
return d
def get_delta(self):