summaryrefslogtreecommitdiff
path: root/tbc
diff options
context:
space:
mode:
authorhardythe12013-11-12 10:56:27 +0530
committerhardythe12013-11-12 10:56:27 +0530
commit3dc86e30d504f9fa470d050e6921a9daf5dbff53 (patch)
treedb8806ecb16f0e04fff46ac2577af645659116f0 /tbc
parent9e58057ed4e2637d1009c4fe891ad0f126662b85 (diff)
downloadPython-TBC-Interface-3dc86e30d504f9fa470d050e6921a9daf5dbff53.tar.gz
Python-TBC-Interface-3dc86e30d504f9fa470d050e6921a9daf5dbff53.tar.bz2
Python-TBC-Interface-3dc86e30d504f9fa470d050e6921a9daf5dbff53.zip
changing automatic push view to add permissions
Diffstat (limited to 'tbc')
-rw-r--r--tbc/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tbc/views.py b/tbc/views.py
index ae29aaa..1e5d0cf 100644
--- a/tbc/views.py
+++ b/tbc/views.py
@@ -256,6 +256,7 @@ def ApproveBook(request, book_id=None):
zip_path = "/"+zip_path+"/Python-Textbook-Companions/"
file_path = file_path+"/static/uploads/"
directory = file_path+book.contributor.user.first_name
+ os.chmod(directory, 0777)
os.chdir(directory)
fp = open(book.title+"/README.txt", 'w')
fp.write("Contributed By: "+book.contributor.user.first_name+" "+book.contributor.user.last_name+"\n")
@@ -270,11 +271,11 @@ def ApproveBook(request, book_id=None):
fp.write("Edition: "+book.edition)
fp.close()
os.popen("cp -r "+book.title+" "+zip_path)
- """os.chdir(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")"""
+ os.popen("git push")
context['user'] = user
return HttpResponseRedirect("/book-review")
elif request.method == 'POST' and request.POST['approve_notify'] == "notify":