Mercurial > public > sg101
comparison bandmap/views.py @ 825:d91356818cef
Bandmap WIP: added test to add band.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 25 Sep 2014 21:15:22 -0500 |
parents | 71db8076dc3d |
children | 5103edd3acc4 |
comparison
equal
deleted
inserted
replaced
824:704b47356a49 | 825:d91356818cef |
---|---|
26 if form.is_valid(): | 26 if form.is_valid(): |
27 band = form.save(commit=False) | 27 band = form.save(commit=False) |
28 band.user = request.user | 28 band.user = request.user |
29 band.save() | 29 band.save() |
30 django_messages.success(request, SUCCESS.format(band.name)) | 30 django_messages.success(request, SUCCESS.format(band.name)) |
31 redirect('bandmap-add') | 31 return redirect('bandmap-add') |
32 else: | 32 else: |
33 form = BandForm() | 33 form = BandForm() |
34 | 34 |
35 return render(request, 'bandmap/add.html', { | 35 return render(request, 'bandmap/add.html', { |
36 'form': form, | 36 'form': form, |