Mercurial > public > sg101
comparison gpp/forums/views.py @ 99:10d6182b9f6e
Forums: added error handling to the flagging of posts. Did the same with the comments function too.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Mon, 14 Sep 2009 00:06:08 +0000 |
parents | d0d779dd0832 |
children | eb9f99382476 |
comparison
equal
deleted
inserted
replaced
98:d0d779dd0832 | 99:10d6182b9f6e |
---|---|
191 """ | 191 """ |
192 This function handles the flagging of posts by users. This function should | 192 This function handles the flagging of posts by users. This function should |
193 be the target of an AJAX post. | 193 be the target of an AJAX post. |
194 """ | 194 """ |
195 if not request.user.is_authenticated(): | 195 if not request.user.is_authenticated(): |
196 return HttpResponse('Please login or register to flag a post.') | 196 return HttpResponseForbidden('Please login or register to flag a post.') |
197 | 197 |
198 id = request.POST.get('id') | 198 id = request.POST.get('id') |
199 if id is None: | 199 if id is None: |
200 return HttpResponseBadRequest('No post id') | 200 return HttpResponseBadRequest('No post id') |
201 | 201 |