You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/01/12 20:15:17 UTC

[GitHub] [airflow] potiuk commented on a change in pull request #13640: Fixes problems with extras for custom connection types

potiuk commented on a change in pull request #13640:
URL: https://github.com/apache/airflow/pull/13640#discussion_r556056371



##########
File path: airflow/www/views.py
##########
@@ -2894,9 +2894,13 @@ def action_muldelete(self, items):
 
     def process_form(self, form, is_created):
         """Process form data."""
-        formdata = form.data
-        if formdata['conn_type'] in ['jdbc', 'google_cloud_platform', 'grpc', 'yandexcloud', 'kubernetes']:
-            extra = {key: formdata[key] for key in self.extra_fields if key in formdata}
+        conn_type = form.data['conn_type']
+        extra = {
+            key: form.data[key]
+            for key in self.extra_fields
+            if key in form.data and key.startswith(f"extra__{conn_type}")

Review comment:
       Oh yeah! Good call :)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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