summaryrefslogtreecommitdiffstats
path: root/dashboard/src
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2018-12-21 10:55:13 -0500
committerParker Berberian <pberberian@iol.unh.edu>2018-12-21 10:55:13 -0500
commit2f272e3878c99ca64eaed8ca7b5e1de85c792eb5 (patch)
tree2d930c36da8880ff1ef197cfa1466ea03ccad149 /dashboard/src
parent1a3b73723f8ed903e428b096fe5458980e813592 (diff)
Fixes creation of ssh access job
Minor changes that allows the ssh job to be created. Django model creation can become very complex when you go beyond the model.object.create() method, and this just fixes the order of operations. Change-Id: I811f26149365067bdd15f2466f8ba9211c3ef901 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'dashboard/src')
-rw-r--r--dashboard/src/api/models.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/dashboard/src/api/models.py b/dashboard/src/api/models.py
index b6bd79f..cc25f82 100644
--- a/dashboard/src/api/models.py
+++ b/dashboard/src/api/models.py
@@ -343,7 +343,7 @@ class AccessConfig(TaskConfig):
user = models.ForeignKey(User, on_delete=models.CASCADE)
revoke = models.BooleanField(default=False)
context = models.TextField(default="")
- delta = models.TextField()
+ delta = models.TextField(default="{}")
def to_dict(self):
d = {}
@@ -691,12 +691,12 @@ class JobFactory(object):
config = AccessConfig()
config.access_type = access_type
config.user = user
- if context:
- config.set_context(context)
config.save()
relation.config = config
relation.save()
config.clear_delta()
+ if context:
+ config.set_context(context)
config.set_access_type(access_type)
config.set_revoke(revoke)
config.set_user(user)