diff options
author | hardythe1 | 2013-12-14 13:14:09 +0530 |
---|---|---|
committer | hardythe1 | 2013-12-14 13:14:09 +0530 |
commit | 8e01ba34eef9ad1b59effbd4edaac43f327c010d (patch) | |
tree | 8533b56cd86344fd8f152267d0713a039412834e | |
parent | 7887212fd544eb9cfde7b476524886fe1c95dc81 (diff) | |
download | Python-TBC-Interface-8e01ba34eef9ad1b59effbd4edaac43f327c010d.tar.gz Python-TBC-Interface-8e01ba34eef9ad1b59effbd4edaac43f327c010d.tar.bz2 Python-TBC-Interface-8e01ba34eef9ad1b59effbd4edaac43f327c010d.zip |
changing the links to tbc-python.fossee.in
-rwxr-xr-x | tbc/templates/base.html | 3 | ||||
-rw-r--r-- | tbc/templates/tbc/book-details.html | 2 | ||||
-rw-r--r-- | tbc/templates/tbc/book-review-details.html | 2 | ||||
-rw-r--r-- | tbc/views.py | 7 |
4 files changed, 11 insertions, 3 deletions
diff --git a/tbc/templates/base.html b/tbc/templates/base.html index a317de5..82855ca 100755 --- a/tbc/templates/base.html +++ b/tbc/templates/base.html @@ -106,6 +106,9 @@ {% if update_book %} <p>Book has been updated successfully </p> {% endif %} + {% if not_found %} + <p>There is no submission to be updated !</p> + {% endif %} <div class="row-fluid"> <center><h3>Latest Books</h3></center> {% for item in items %} diff --git a/tbc/templates/tbc/book-details.html b/tbc/templates/tbc/book-details.html index 5c141b1..7b76572 100644 --- a/tbc/templates/tbc/book-details.html +++ b/tbc/templates/tbc/book-details.html @@ -14,7 +14,7 @@ <hr> <ol> {% for chapter in chapters %} - <li><a href="https://nbviewer.ipython.org/url/dev.fossee.in{% static 'uploads/' %}{{ chapter.notebook }}">{{ chapter.name }}</a> + <li><a href="http://nbviewer.ipython.org/url/tbc-python.fossee.in/{% static 'uploads/' %}{{ chapter.notebook }}">{{ chapter.name }}</a> {% endfor %} </ol> <hr> diff --git a/tbc/templates/tbc/book-review-details.html b/tbc/templates/tbc/book-review-details.html index 5ea3f5b..6c4fbd0 100644 --- a/tbc/templates/tbc/book-review-details.html +++ b/tbc/templates/tbc/book-review-details.html @@ -13,7 +13,7 @@ <hr> <ol> {% for chapter in chapters %} - <li><a href="https://nbviewer.ipython.org/url/dev.fossee.in{% static 'uploads/' %}{{ chapter.notebook }}">{{ chapter.name }}</a> + <li><a href="http://nbviewer.ipython.org/url/tbc-python.fossee.in{% static 'uploads/' %}{{ chapter.notebook }}">{{ chapter.name }}</a> {% endfor %} </ol> <hr> diff --git a/tbc/views.py b/tbc/views.py index 2556e1f..0a5dbf5 100644 --- a/tbc/views.py +++ b/tbc/views.py @@ -51,6 +51,8 @@ def Home(request): context['logout'] = True if 'update_book' in request.GET: context['update_book'] = True + if 'not_found' in request.GET: + context['not_found'] = True books = Book.objects.filter(approved=True)[0:6] for book in books: images.append(ScreenShots.objects.filter(book=book)[0]) @@ -169,7 +171,10 @@ def SubmitBook(request): def UpdateBook(request): current_user = request.user user_profile = Profile.objects.get(user=current_user) - book_to_update = Book.objects.get(contributor=user_profile, approved=False) + try: + book_to_update = Book.objects.get(contributor=user_profile, approved=False) or None + except: + return HttpResponseRedirect("/?not_found=True") title = book_to_update.title chapters = Chapters.objects.filter(book=book_to_update) screenshots = ScreenShots.objects.filter(book=book_to_update) |