RNHTTR commented on code in PR #41144:
URL: https://github.com/apache/airflow/pull/41144#discussion_r1698715142


##########
airflow/www/views.py:
##########
@@ -4375,6 +4377,18 @@ def process_form(self, form, is_created):
                     # value isn't an empty string.
                     if value != "":
                         extra[field_name] = value
+                    field = form._fields.get(key)
+                    # Check if the field is a BS3TextFieldWidget
+                    if isinstance(field.widget, BS3TextFieldWidget):
+                        value = form.data.get(key, "")
+                        if isinstance(value, str):
+                            value = value.strip()
+                            if value:
+                                field_label = str(field.label.text)
+                                flash(
+                                    f"The field '{field_label}' can be 
modified but cannot be deleted.",

Review Comment:
   ```suggestion
                                       f"The field '{field_label}' was not 
deleted, because populated fields can't be deleted.",
   ```



##########
airflow/www/views.py:
##########
@@ -4375,6 +4377,18 @@ def process_form(self, form, is_created):
                     # value isn't an empty string.
                     if value != "":
                         extra[field_name] = value
+                    field = form._fields.get(key)
+                    # Check if the field is a BS3TextFieldWidget
+                    if isinstance(field.widget, BS3TextFieldWidget):
+                        value = form.data.get(key, "")
+                        if isinstance(value, str):
+                            value = value.strip()
+                            if value:

Review Comment:
   Isn't this warning users even if the field data has not been deleted? I 
don't think we need to show a warning when a user modifies an existing value. 
If it's not possible to determine whether a field was previously populated, I 
think we should just leave do nothing.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to