{"action":"opened","issue":{"url":"https://api.github.com/repos/pivotal-energy-solutions/django-datatable-view/issues/119","labels_url":"https://api.github.com/repos/pivotal-energy-solutions/django-datatable-view/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/pivotal-energy-solutions/django-datatable-view/issues/119/comments","events_url":"https://api.github.com/repos/pivotal-energy-solutions/django-datatable-view/issues/119/events","html_url":"https://github.com/pivotal-energy-solutions/django-datatable-view/issues/119","id":119284508,"number":119,"title":"Exception when iDisplayLength=-1 (all)","user":{"login":"javiersanp","id":1605829,"avatar_url":"https://avatars.githubusercontent.com/u/1605829?v=3","gravatar_id":"","url":"https://api.github.com/users/javiersanp","html_url":"https://github.com/javiersanp","followers_url":"https://api.github.com/users/javiersanp/followers","following_url":"https://api.github.com/users/javiersanp/following{/other_user}","gists_url":"https://api.github.com/users/javiersanp/gists{/gist_id}","starred_url":"https://api.github.com/users/javiersanp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiersanp/subscriptions","organizations_url":"https://api.github.com/users/javiersanp/orgs","repos_url":"https://api.github.com/users/javiersanp/repos","events_url":"https://api.github.com/users/javiersanp/events{/privacy}","received_events_url":"https://api.github.com/users/javiersanp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-28T10:31:19Z","updated_at":"2015-11-28T10:31:19Z","closed_at":null,"body":"In version '0.9.0', when you make a request to DatatableView with iDisplayLenght set to -1 (all registers), the following exception is raised:\r\n\r\nUnboundLocalError at / local variable 'object_list' referenced before assignment\r\nTraceback:\r\nFile \"/home/javier/.virtualenvs/ssbb_dev/lib/python3.4/site-packages/datatableview/datatables.py\" in _get_current_page\r\n  406.         return object_list\r\n\r\nThe code of _get_current_page method of Datatable class have an if statement that leaves the variable object_list unassigned when self.config['page_length'] == -1\r\n\r\nYou can fix it adding a line with object_list = self._records just before the if.\r\n\r\nBest regards."}}