'Process response'

def process_response(self, request, response):

    if ((not getattr(request, 'user', None)) or (not request.user.username)):
        return response
    try:
        signals.post_save.disconnect(dispatch_uid=request.user)
    except AttributeError:
        pass
    view = None
    try:
        (view, args, kwargs) = resolve(request.path)
    except Exception:
        pass
    if ((view == ajax_popup) and (response.status_code == 302)):
        for obj in self.objects:
            if (self.objects[obj]['request'] == request):
                hobject = self.objects[obj]['object']
                content = json.loads(response.content)
                content['popup'].update({'object': {'name': unicode(hobject), 'id': obj}})
                response = HttpResponse(json.dumps(content), content_type=settings.HARDTREE_RESPONSE_FORMATS['json'])
                break
        content = json.loads(response.content)
        content['popup'].update({'redirect': True})
        response = HttpResponse(json.dumps(content), content_type=settings.HARDTREE_RESPONSE_FORMATS['json'])
    return response
