def _render_error(request, message): return status_redirect( request, title=_('Error'), section=_("OpenID Server"), message=message, next='/' )
def unsubscribe(request, user_id): profile = get_object_or_404(Profile, pk=user_id) form = SubscriptionForm(user=profile, data=request.GET) form.fields['code'].required=True if form.is_valid(): form.process() return status_redirect( request, title=_("Unsubscribed"), section=_("Watchlist"), message=_("You've been unsubscribed from new comment notification"), next="/" ) return http.HttpResponseBadRequest('Post not found or bad action or bad code')