{"action":"created","issue":{"url":"https://api.github.com/repos/apache/incubator-airflow/issues/2324","repository_url":"https://api.github.com/repos/apache/incubator-airflow","labels_url":"https://api.github.com/repos/apache/incubator-airflow/issues/2324/labels{/name}","comments_url":"https://api.github.com/repos/apache/incubator-airflow/issues/2324/comments","events_url":"https://api.github.com/repos/apache/incubator-airflow/issues/2324/events","html_url":"https://github.com/apache/incubator-airflow/pull/2324","id":231322309,"number":2324,"title":"[AIRFLOW-1244] Forbid creation of a pool with empty name","user":{"login":"skudriashev","id":2817012,"avatar_url":"https://avatars2.githubusercontent.com/u/2817012?v=3","gravatar_id":"","url":"https://api.github.com/users/skudriashev","html_url":"https://github.com/skudriashev","followers_url":"https://api.github.com/users/skudriashev/followers","following_url":"https://api.github.com/users/skudriashev/following{/other_user}","gists_url":"https://api.github.com/users/skudriashev/gists{/gist_id}","starred_url":"https://api.github.com/users/skudriashev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skudriashev/subscriptions","organizations_url":"https://api.github.com/users/skudriashev/orgs","repos_url":"https://api.github.com/users/skudriashev/repos","events_url":"https://api.github.com/users/skudriashev/events{/privacy}","received_events_url":"https://api.github.com/users/skudriashev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-05-25T12:09:45Z","updated_at":"2017-06-04T16:13:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/incubator-airflow/pulls/2324","html_url":"https://github.com/apache/incubator-airflow/pull/2324","diff_url":"https://github.com/apache/incubator-airflow/pull/2324.diff","patch_url":"https://github.com/apache/incubator-airflow/pull/2324.patch"},"body":"Dear Airflow maintainers,\r\n\r\nPlease accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!\r\n\r\n\r\n### JIRA\r\n- [x] My PR addresses the following:\r\n    - [AIRFLOW-1244](https://issues.apache.org/jira/browse/AIRFLOW-1244) Forbid creation of a pool with empty name\r\n\r\n\r\n### Description\r\n- [x] Here are some details about my PR, including screenshots of any UI changes:\r\n    - Currently creation of a pool with empty name fails with exception. This needs to be fixed.\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask/app.py\", line 2000, in __call__\r\n    return self.wsgi_app(environ, start_response)\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask/app.py\", line 1991, in wsgi_app\r\n    response = self.make_response(self.handle_exception(e))\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask/app.py\", line 1567, in handle_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask/app.py\", line 1988, in wsgi_app\r\n    response = self.full_dispatch_request()\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask/app.py\", line 1641, in full_dispatch_request\r\n    rv = self.handle_user_exception(e)\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask/app.py\", line 1544, in handle_user_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask/app.py\", line 1639, in full_dispatch_request\r\n    rv = self.dispatch_request()\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask/app.py\", line 1625, in dispatch_request\r\n    return self.view_functions[rule.endpoint](**req.view_args)\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask_admin/base.py\", line 69, in inner\r\n    return self._run_view(f, *args, **kwargs)\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask_admin/base.py\", line 368, in _run_view\r\n    return fn(self, *args, **kwargs)\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask_admin/model/base.py\", line 1900, in index_view\r\n    return_url=self._get_list_url(view_args),\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask_admin/base.py\", line 308, in render\r\n    return render_template(template, **kwargs)\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask/templating.py\", line 134, in render_template\r\n    context, ctx.app)\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask/templating.py\", line 116, in _render\r\n    rv = template.render(context)\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/jinja2/environment.py\", line 989, in render\r\n    return self.environment.handle_exception(exc_info, True)\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/jinja2/environment.py\", line 754, in handle_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/home/stas/Work/incubator-airflow/airflow/www/templates/airflow/model_list.html\", line 18, in top-level template code\r\n    {% extends 'admin/model/list.html' %}\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask_admin/templates/bootstrap3/admin/model/list.html\", line 6, in top-level template code\r\n    {% import 'admin/model/row_actions.html' as row_actions with context %}\r\n  File \"/home/stas/Work/incubator-airflow/airflow/www/templates/admin/master.html\", line 18, in top-level template code\r\n    {% extends 'admin/base.html' %}\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask_admin/templates/bootstrap3/admin/base.html\", line 30, in top-level template code\r\n    {% block page_body %}\r\n  File \"/home/stas/Work/incubator-airflow/airflow/www/templates/admin/master.html\", line 104, in block \"page_body\"\r\n    {% block body %}\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask_admin/templates/bootstrap3/admin/model/list.html\", line 62, in block \"body\"\r\n    {% block model_list_table %}\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask_admin/templates/bootstrap3/admin/model/list.html\", line 110, in block \"model_list_table\"\r\n    {% block list_row scoped %}\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask_admin/templates/bootstrap3/admin/model/list.html\", line 138, in block \"list_row\"\r\n    {{ get_value(row, c) }}\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask_admin/model/base.py\", line 1742, in get_list_value\r\n    self.column_type_formatters,\r\n  File \"/home/stas/Work/incubator-airflow/.venv/lib/python2.7/site-packages/flask_admin/model/base.py\", line 1707, in _get_list_value\r\n    value = column_fmt(self, context, model, name)\r\n  File \"/home/stas/Work/incubator-airflow/airflow/www/views.py\", line 187, in pool_link\r\n    url = '/admin/taskinstance/?flt1_pool_equals=' + m.pool\r\nTypeError: cannot concatenate 'str' and 'NoneType' objects\r\n```\r\n\r\n### Tests\r\n- [x] The following tests added:\r\n - tests.www.test_views:TestViews.test_pool_model_view_create_pool\r\n - tests.www.test_views:TestViews.test_pool_model_view_create_pool_already_exists\r\n - tests.www.test_views:TestViews.test_pool_model_view_create_pool_with_empty_name\r\n\r\n\r\n### Commits\r\n- [x] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from \"[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)\":\r\n    1. Subject is separated from body by a blank line\r\n    2. Subject is limited to 50 characters\r\n    3. Subject does not end with a period\r\n    4. Subject uses the imperative mood (\"add\", not \"adding\")\r\n    5. Body wraps at 72 characters\r\n    6. Body explains \"what\" and \"why\", not \"how\"\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apache/incubator-airflow/issues/comments/306049786","html_url":"https://github.com/apache/incubator-airflow/pull/2324#issuecomment-306049786","issue_url":"https://api.github.com/repos/apache/incubator-airflow/issues/2324","id":306049786,"user":{"login":"skudriashev","id":2817012,"avatar_url":"https://avatars2.githubusercontent.com/u/2817012?v=3","gravatar_id":"","url":"https://api.github.com/users/skudriashev","html_url":"https://github.com/skudriashev","followers_url":"https://api.github.com/users/skudriashev/followers","following_url":"https://api.github.com/users/skudriashev/following{/other_user}","gists_url":"https://api.github.com/users/skudriashev/gists{/gist_id}","starred_url":"https://api.github.com/users/skudriashev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skudriashev/subscriptions","organizations_url":"https://api.github.com/users/skudriashev/orgs","repos_url":"https://api.github.com/users/skudriashev/repos","events_url":"https://api.github.com/users/skudriashev/events{/privacy}","received_events_url":"https://api.github.com/users/skudriashev/received_events","type":"User","site_admin":false},"created_at":"2017-06-04T16:13:52Z","updated_at":"2017-06-04T16:13:52Z","body":"@r39132, I think this is not related to the current ticket and should be fixed separately."}}
{"actor":{"display_login":"skudriashev"}}