ron819 closed pull request #3948: [AIRFLOW-3071] clear Val of Variable from the 
UI
URL: https://github.com/apache/incubator-airflow/pull/3948
 
 
   

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..0cd17b0623 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -2022,11 +2022,10 @@ def variables(self, form):
         try:
             if request.method == 'POST':
                 data = request.json
-                if data:
-                    with create_session() as session:
-                        var = models.Variable(key=form, val=json.dumps(data))
-                        session.add(var)
-                        session.commit()
+                with create_session() as session:
+                    var = models.Variable(key=form, val=json.dumps(data))
+                    session.add(var)
+                    session.commit()
                 return ""
             else:
                 return self.render(


 

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to