diff options
-rwxr-xr-x | tbc/views.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tbc/views.py b/tbc/views.py index 8a29afb..0dc1488 100755 --- a/tbc/views.py +++ b/tbc/views.py @@ -1135,7 +1135,10 @@ def GetCertificate(request, book_id=None): if book_id: try: book = Book.objects.get(id=book_id) - proposal_id = Proposal.objects.get(accepted=book_id).id + try: + proposal_id = Proposal.objects.get(accepted=book_id).id + except DoesNotExist: + proposal_id = None title = book.title edition = book.edition course = user_profile.course |