diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2018-11-09 11:10:03 -0500 |
---|---|---|
committer | Parker Berberian <pberberian@iol.unh.edu> | 2019-01-02 09:35:41 -0500 |
commit | 21919476d791c24be54a447f9b7e32f74d3bd4b4 (patch) | |
tree | fa16ce05e0bbf31f9f1cff1039c5a7dbde5f4267 /src/booking/views.py | |
parent | b361d6df77ab59bb0f227aec00c19b080f31bc50 (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 'src/booking/views.py')
-rw-r--r-- | src/booking/views.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/booking/views.py b/src/booking/views.py index ab43519..29b53e2 100644 --- a/src/booking/views.py +++ b/src/booking/views.py @@ -112,7 +112,7 @@ def booking_detail_view(request, booking_id): { 'title': 'Booking Details', 'booking': booking, - 'pdf': ResourceManager().makePDF(booking.resource), + 'pdf': booking.pdf, 'user_id': user.id }) |