diff options
-rw-r--r-- | allotter/forms.py | 2 | ||||
-rw-r--r-- | allotter/views.py | 2 | ||||
-rw-r--r-- | settings.py | 2 | ||||
-rw-r--r-- | template/allotter/complete.html | 2 | ||||
-rw-r--r-- | urls.py | 2 |
5 files changed, 6 insertions, 4 deletions
diff --git a/allotter/forms.py b/allotter/forms.py index b3a9039..6bd1400 100644 --- a/allotter/forms.py +++ b/allotter/forms.py @@ -98,7 +98,7 @@ class UserDetailsForm(forms.Form): self.helper.form_id = 'id-detailsform' self.helper.form_method = 'post' self.helper.form_class = 'form-horizontal' - self.helper.form_action = "/allotter/details/" + self.helper.form_action = "/allotter/"+user.username+"/details/" self.helper.add_input(Submit('submit', 'Submit')) super(UserDetailsForm, self).__init__(*args, **kwargs) diff --git a/allotter/views.py b/allotter/views.py index f4c83e5..93a1660 100644 --- a/allotter/views.py +++ b/allotter/views.py @@ -67,7 +67,7 @@ def submit_details(request, reg_no): if form.is_valid(): data = form.cleaned_data form.save() - return redirect("/allotter/apply/") + return HttpResponseRedirect(reverse('allotter.views.apply', args=(user.username,))) else: return render(request, 'allotter/details.html', {'form':form}) diff --git a/settings.py b/settings.py index eaedc8d..a1ccac9 100644 --- a/settings.py +++ b/settings.py @@ -60,7 +60,7 @@ MEDIA_ROOT = '' # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" -MEDIA_URL = '' +MEDIA_URL = '/media/' # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files diff --git a/template/allotter/complete.html b/template/allotter/complete.html index ee482a3..9374dae 100644 --- a/template/allotter/complete.html +++ b/template/allotter/complete.html @@ -46,11 +46,11 @@ An email with the list of options has been sent {{ email }} for book-keeping pur <input type="submit" name="apply" value="Edit Options" class="btn" /> </form> +<a href="{{ STATIC_URL }}files/iiitb_voucher.pdf" class="btn pull-right" >Download pdf</a> <form id ="get_pdf" action="/allotter/{{username}}/get_pdf/" method="post"> {% csrf_token %} <input type="submit" name="get_pdf" value="Generate PDF" class="btn" /> </form> - <form id="logout" action="/allotter/logout/" method="post"> {% csrf_token %} <input type="submit" name="logout" value="Quit Allotment" class="btn" /> @@ -1,4 +1,6 @@ +from django.conf import settings from django.conf.urls.defaults import patterns, include, url +from django.conf.urls.static import static from django.contrib import admin |