airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] XD-DENG closed pull request #3731: [AIRFLOW-2885] Fix a bug in www_rbac.utils.get_params
Date Thu, 16 Aug 2018 02:53:30 GMT
XD-DENG closed pull request #3731: [AIRFLOW-2885] Fix a bug in www_rbac.utils.get_params
URL: https://github.com/apache/incubator-airflow/pull/3731
 
 
   

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_rbac/utils.py b/airflow/www_rbac/utils.py
index 7bbdada555..ddbf90afd9 100644
--- a/airflow/www_rbac/utils.py
+++ b/airflow/www_rbac/utils.py
@@ -66,7 +66,7 @@ def get_params(**kwargs):
             if v or v is None:
                 continue
             params.append('{}={}'.format(k, v))
-        elif v:
+        elif v is not None:
             params.append('{}={}'.format(k, v))
     params = sorted(params, key=lambda x: x.split('=')[0])
     return '&'.join(params)
diff --git a/tests/www_rbac/test_utils.py b/tests/www_rbac/test_utils.py
index 05114881dd..1f5df30fd8 100644
--- a/tests/www_rbac/test_utils.py
+++ b/tests/www_rbac/test_utils.py
@@ -109,6 +109,11 @@ def test_params_all(self):
         self.assertEqual('page=3&search=bash_&showPaused=False',
                          utils.get_params(showPaused=False, page=3, search='bash_'))
 
+    def test_params_all_page_zero(self):
+        """Should return params string ordered by param key"""
+        self.assertEqual('page=0&search=bash_&showPaused=False',
+                         utils.get_params(showPaused=False, page=0, search='bash_'))
+
 
 if __name__ == '__main__':
     unittest.main()


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message