summaryrefslogtreecommitdiff
path: root/tbc
diff options
context:
space:
mode:
authorhardythe12015-05-08 13:20:59 +0530
committerhardythe12015-05-08 13:20:59 +0530
commit285a24aeb96bfcf2744a4dddd8c72a598568e652 (patch)
tree16ab6de15357a92909d7990f675938b1b12ee07a /tbc
parent055bab04664a61aaa92cb8eef39ca2321917e04e (diff)
downloadPython-TBC-Interface-285a24aeb96bfcf2744a4dddd8c72a598568e652.tar.gz
Python-TBC-Interface-285a24aeb96bfcf2744a4dddd8c72a598568e652.tar.bz2
Python-TBC-Interface-285a24aeb96bfcf2744a4dddd8c72a598568e652.zip
Handle POST for additional chapters
Diffstat (limited to 'tbc')
-rwxr-xr-xtbc/views.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tbc/views.py b/tbc/views.py
index ba97835..404d644 100755
--- a/tbc/views.py
+++ b/tbc/views.py
@@ -855,7 +855,14 @@ def SubmitCode(request):
chapter.save()
counter += 1
num_new_chapters = curr_book.no_chapters - old_chapter_count
- return HttpResponse(num_new_chapters)
+ if num_new_chapters > 0:
+ for i in range(num_new_chapters):
+ new_chapter = Chapters()
+ new_chapter.book = curr_book
+ new_chapter.name = request.POST['chapter'+str(counter)]
+ new_chapter.notebook = request.FILES['notebook'+str(counter)]
+ new_chapter.save()
+ counter += 1
counter = 1
for screenshot in screen_shots:
screenshot.caption = request.POST['caption'+str(counter)]