comparison gpp/messages/views.py @ 431:0d91176cf9b3

More work on #211. The compose view now returns the tab fragment HTML so errors can be displayed correctly.
author Brian Neal <bgneal@gmail.com>
date Fri, 06 May 2011 00:02:55 +0000
parents 9df368d9775d
children 241c80ff16c5
comparison
equal deleted inserted replaced
430:9df368d9775d 431:0d91176cf9b3
210 parent_msg = None 210 parent_msg = None
211 211
212 if compose_form.is_valid(): 212 if compose_form.is_valid():
213 compose_form.save(parent_msg=parent_msg) 213 compose_form.save(parent_msg=parent_msg)
214 messages.success(request, 'Message sent.') 214 messages.success(request, 'Message sent.')
215 return HttpResponseRedirect(reverse('messages-index_named', args=['compose'])) 215 compose_form = ComposeForm(request.user)
216 else: 216 else:
217 if receiver is not None: 217 if receiver is not None:
218 form_data = {'receiver': receiver} 218 form_data = {'receiver': receiver}
219 compose_form = ComposeForm(request.user, initial=form_data) 219 compose_form = ComposeForm(request.user, initial=form_data)
220 else: 220 else: