def post(self, request, *args, **kwargs): if request.is_ajax(): print self.request.user.username clear_notifications_template_cache(request.user.username) return self.render_json_response({'result': 'ok'}) return HttpResponseForbidden()
def post(self, request, *args, **kwargs): Message.objects.filter(user=request.user).update(read=True) clear_notifications_template_cache(request.user.username) return redirect(request.POST.get('next', '/'))
def persistent_message_post_save(sender, instance, **kwargs): clear_notifications_template_cache(instance.user.username)
def post(self, request, *args, **kwargs): Message.objects.filter(user = request.user).update(read = True) clear_notifications_template_cache(request.user.username) return redirect(request.POST.get('next', '/'))