[
https://issues.apache.org/jira/browse/AIRFLOW-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16637892#comment-16637892
]
ASF GitHub Bot commented on AIRFLOW-1354:
-----------------------------------------
ecederstrand closed pull request #3993: [AIRFLOW-1354] Fix pool_link() return
value
URL: https://github.com/apache/incubator-airflow/pull/3993
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/airflow/www/views.py b/airflow/www/views.py
index d9078caa39..7318624f11 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -207,7 +207,7 @@ def label_link(v, c, m, p):
def pool_link(v, c, m, p):
- url = '/admin/taskinstance/?flt1_pool_equals=' + m.pool
+ url = '/admin/pool/?flt1_pool_equals=' + m.pool
return Markup("<a href='{url}'>{m.pool}</a>".format(**locals()))
diff --git a/tests/www/test_views.py b/tests/www/test_views.py
index 734b28bcdc..e944f18644 100644
--- a/tests/www/test_views.py
+++ b/tests/www/test_views.py
@@ -242,6 +242,7 @@ def
test_create_known_event_with_end_data_earlier_than_start_date(self):
class TestPoolModelView(unittest.TestCase):
CREATE_ENDPOINT = '/admin/pool/new/?url=/admin/pool/'
+ LIST_ENDPOINT = '/admin/pool/'
@classmethod
def setUpClass(cls):
@@ -305,6 +306,22 @@ def test_create_pool_with_empty_name(self):
self.assertIn('This field is required.', response.data.decode('utf-8'))
self.assertEqual(self.session.query(models.Pool).count(), 0)
+ def test_list_pools(self):
+ # create test pool
+ self.app.post(
+ self.CREATE_ENDPOINT,
+ data=self.pool,
+ follow_redirects=True,
+ )
+ # Get the list of pools
+ response = self.app.get(self.LIST_ENDPOINT)
+ content = response.data.decode('utf-8')
+ self.assertIn(self.pool['pool'], content)
+ self.assertIn(
+ "<a href='/admin/pool/?flt1_pool_equals=test-pool'>test-pool</a>",
+ content
+ )
+
class TestLogView(unittest.TestCase):
DAG_ID = 'dag_for_testing_log_view'
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> www/views.py pool_link produces wrong link
> ------------------------------------------
>
> Key: AIRFLOW-1354
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1354
> Project: Apache Airflow
> Issue Type: Bug
> Components: webapp
> Affects Versions: 1.10.0
> Reporter: Erik Cederstrand
> Priority: Minor
>
> The pool_link() function in www/views.py which produces the link on the pool
> names in the [/admin/pool/|http://green.nzcorp.net:7105/admin/pool/] list
> view builds a link to
> {code:none}
> '/admin/taskinstance/?flt1_pool_equals=' + m.pool{code}
> but should return
> {code:none}
> '/admin/pool/?flt1_pool_equals=' + m.pool{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)