From aac8f596c18274917bb8fbd1361ce1c80273d5cb Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Tue, 19 Nov 2013 14:47:56 +0530 Subject: making changes to approve a book --- tbc/static/css/base.css | 1 + tbc/templates/base.html | 3 ++- tbc/views.py | 9 ++------- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tbc/static/css/base.css b/tbc/static/css/base.css index 1c3572e..c3d835e 100755 --- a/tbc/static/css/base.css +++ b/tbc/static/css/base.css @@ -6178,6 +6178,7 @@ a.badge:focus { height: 220px; margin: 20px 0 0 20px; padding: 10px; + padding-bottom: 35px; position: relative; width: 300px; } diff --git a/tbc/templates/base.html b/tbc/templates/base.html index bcbf19b..9a47446 100755 --- a/tbc/templates/base.html +++ b/tbc/templates/base.html @@ -81,11 +81,12 @@

Latest Books

{% for item in items %}
-
{{ item.book.title }}
+
{% endfor %} +

Browse All Books {% endblock %} diff --git a/tbc/views.py b/tbc/views.py index 2a5b950..d19d7d3 100644 --- a/tbc/views.py +++ b/tbc/views.py @@ -9,6 +9,7 @@ import os import zipfile import StringIO import smtplib +import shutil from email.mime.text import MIMEText @@ -255,7 +256,6 @@ def ApproveBook(request, book_id=None): zip_path = "/".join(file_path.split("/")[1:-2]) zip_path = "/"+zip_path+"/Python-Textbook-Companions/" file_path = file_path+"/static/uploads/" - return HttpResponse(file_path) directory = file_path+book.contributor.user.first_name os.chmod(directory, 0777) os.chdir(directory) @@ -271,12 +271,7 @@ def ApproveBook(request, book_id=None): fp.write("Isbn: "+book.isbn+"\n") fp.write("Edition: "+book.edition) fp.close() - os.popen("cp -r "+book.title+" "+zip_path) - os.chdir(zip_path) - os.popen("git add .") - commit_msg = "adding "+book.title - os.popen("git commit -m "+commit_msg) - os.popen("git push") + x = shutil.copytree(book.title, zip_path+book.title) context['user'] = user return HttpResponseRedirect("/book-review") elif request.method == 'POST' and request.POST['approve_notify'] == "notify": -- cgit