Mercurial > public > sg101
comparison news/views.py @ 998:e2c3d7ecfa30
Added tests for submit news.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 20 Nov 2015 23:07:37 -0600 |
parents | 19b86e684cc2 |
children | c6c3ba5cf6eb |
comparison
equal
deleted
inserted
replaced
997:19b86e684cc2 | 998:e2c3d7ecfa30 |
---|---|
141 def submit(request): | 141 def submit(request): |
142 if request.method == "POST": | 142 if request.method == "POST": |
143 add_form = AddNewsForm(request.POST) | 143 add_form = AddNewsForm(request.POST) |
144 if add_form.is_valid(): | 144 if add_form.is_valid(): |
145 add_form.save(request.user) | 145 add_form.save(request.user) |
146 return HttpResponseRedirect(reverse('news.views.submit_thanks')) | 146 return HttpResponseRedirect(reverse('news-submit_thanks')) |
147 else: | 147 else: |
148 add_form = AddNewsForm() | 148 add_form = AddNewsForm() |
149 | 149 |
150 return render_to_response('news/submit_news.html', { | 150 return render_to_response('news/submit_news.html', { |
151 'add_form': add_form, | 151 'add_form': add_form, |