Mercurial > public > sg101
comparison gpp/shoutbox/views.py @ 151:e1d1a70d312d
Implement #43, various shoutbox improvements.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 18 Dec 2009 04:30:49 +0000 |
parents | a20b2c492d55 |
children | 7ddd60164245 |
comparison
equal
deleted
inserted
replaced
150:b43e1288ff80 | 151:e1d1a70d312d |
---|---|
8 from django.core.paginator import InvalidPage | 8 from django.core.paginator import InvalidPage |
9 from django.http import HttpResponse | 9 from django.http import HttpResponse |
10 from django.http import HttpResponseBadRequest | 10 from django.http import HttpResponseBadRequest |
11 from django.http import HttpResponseForbidden | 11 from django.http import HttpResponseForbidden |
12 from django.http import HttpResponseRedirect | 12 from django.http import HttpResponseRedirect |
13 from django.http import Http404 | |
13 from django.contrib.auth.decorators import login_required | 14 from django.contrib.auth.decorators import login_required |
14 from django.views.decorators.http import require_POST | 15 from django.views.decorators.http import require_POST |
15 | 16 |
16 from core.paginator import DiggPaginator | 17 from core.paginator import DiggPaginator |
17 from core.functions import email_admins | 18 from core.functions import email_admins |
98 new_shout = request.POST.get('value', '').strip() | 99 new_shout = request.POST.get('value', '').strip() |
99 if new_shout == '': | 100 if new_shout == '': |
100 return HttpResponseBadRequest() | 101 return HttpResponseBadRequest() |
101 shout.shout = new_shout | 102 shout.shout = new_shout |
102 shout.save() | 103 shout.save() |
103 return render_to_response('shoutbox/render_shout.html', { | 104 return HttpResponse(shout.html) |
104 'shout': shout, | |
105 }, | |
106 context_instance = RequestContext(request)) | |
107 | 105 |
108 return HttpResponseForbidden() | 106 return HttpResponseForbidden() |
109 | 107 |
110 | 108 |
111 def delete(request): | 109 def delete(request): |