airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject incubator-airflow git commit: [AIRFLOW-1200] Forbid creation of a variable with an empty key
Date Wed, 17 May 2017 18:54:10 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/v1-8-test 17233ea77 -> e2456f07c


[AIRFLOW-1200] Forbid creation of a variable with an empty key

Closes #2299 from skudriashev/airflow-1200

(cherry picked from commit 3acfa048a88342ca059afd9329e7ba4cf1af0929)
Signed-off-by: Bolke de Bruin <bolke@xs4all.nl>


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/e2456f07
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/e2456f07
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/e2456f07

Branch: refs/heads/v1-8-test
Commit: e2456f07c8da00c3daef5e6a2a56611ccfc48cf9
Parents: 17233ea
Author: Stanislav Kudriashev <stas.kudriashev@gmail.com>
Authored: Wed May 17 20:53:50 2017 +0200
Committer: Bolke de Bruin <bolke@xs4all.nl>
Committed: Wed May 17 20:54:02 2017 +0200

----------------------------------------------------------------------
 airflow/www/views.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/e2456f07/airflow/www/views.py
----------------------------------------------------------------------
diff --git a/airflow/www/views.py b/airflow/www/views.py
index 3ed58a8..7267ad7 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -2138,13 +2138,20 @@ class VariableView(wwwutils.DataProfilingMixin, AirflowModelView):
             'rows': 20,
         }
     }
+    form_args = {
+        'key': {
+            'validators': {
+                validators.DataRequired(),
+            },
+        },
+    }
     column_sortable_list = (
         'key',
         'val',
         'is_encrypted',
     )
     column_formatters = {
-        'val': hidden_field_formatter
+        'val': hidden_field_formatter,
     }
 
     # Default flask-admin export functionality doesn't handle serialized json


Mime
View raw message