summaryrefslogtreecommitdiffstats
path: root/dashboard/src/workflow
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2018-11-09 11:10:03 -0500
committerParker Berberian <pberberian@iol.unh.edu>2019-01-02 09:35:41 -0500
commit28a35133ff325aab59204df7372d7cc78ca5e64c (patch)
treeba0c13f7ed0e7fc5559075e6444b9af7c5de0edc /dashboard/src/workflow
parentb02aa2535c7b7beacbc2d7d24d8522fa596afeee (diff)
Renders Pod Destriptor File earlier
Currently, the PDF is rendered 'on-demand' every time you visit the booking detail page. This change renders the pdf once and saves it in the booking model. Advantages: - saves computation of re-rendering pdf constantly - fixes issue where pdf fails to render after booking expires Change-Id: I58d20fadce088d78ebd22f1d6f67cab371823542 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'dashboard/src/workflow')
-rw-r--r--dashboard/src/workflow/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/dashboard/src/workflow/models.py b/dashboard/src/workflow/models.py
index 966582c..6a8eca1 100644
--- a/dashboard/src/workflow/models.py
+++ b/dashboard/src/workflow/models.py
@@ -459,6 +459,12 @@ class Repository():
booking.collaborators.add(collaborator)
try:
+ booking.pdf = ResourceManager().makePDF(booking.resource)
+ booking.save()
+ except Exception as e:
+ return "BOOK, failed to create Pod Desriptor File: " + str(e)
+
+ try:
JobFactory.makeCompleteJob(booking)
except Exception as e:
return "BOOK, serializing for api generated exception: " + str(e) + " CODE:0xFFFF"