diff --git a/moped-etl/arcgis/components_to_agol.py b/moped-etl/arcgis/components_to_agol.py index c230376713..0cba56b9f1 100644 --- a/moped-etl/arcgis/components_to_agol.py +++ b/moped-etl/arcgis/components_to_agol.py @@ -53,31 +53,31 @@ def is_valid_HTML_tag(html_string_to_check): return html_string_to_check == str(soup) -def handle_status_updates(features): - """Check project status updates for valid or invalid HTML; escape HTML if needed. - Project status updates can be plain text, valid HTML, or invalid HTML. If invalid HTML is found, - the content of the update is escaped to prevent it from being rejected by AGOL (504 or 400 error). +# def handle_status_updates(features): +# """Check project status updates for valid or invalid HTML; escape HTML if needed. +# Project status updates can be plain text, valid HTML, or invalid HTML. If invalid HTML is found, +# the content of the update is escaped to prevent it from being rejected by AGOL (504 or 400 error). - Args: - features (list): list of Esri feature objects +# Args: +# features (list): list of Esri feature objects - Returns: - list: list of Esri feature objects with status update HTML escaped if needed - """ - for record in features: - id = record["attributes"]["project_id"] +# Returns: +# list: list of Esri feature objects with status update HTML escaped if needed +# """ +# for record in features: +# id = record["attributes"]["project_id"] - status_update = record["attributes"]["project_status_update"] +# status_update = record["attributes"]["project_status_update"] - if status_update != None and has_html_tags(status_update): - if not is_valid_HTML_tag(status_update): - logger.info( - f"Invalid HTML tag found in project_id: {id}. Getting HTML text..." - ) - html_text = BeautifulSoup(status_update, "html.parser").get_text() - record["attributes"]["project_status_update"] = html_text +# if status_update != None and has_html_tags(status_update): +# if not is_valid_HTML_tag(status_update): +# logger.info( +# f"Invalid HTML tag found in project_id: {id}. Getting HTML text..." +# ) +# html_text = BeautifulSoup(status_update, "html.parser").get_text() +# record["attributes"]["project_status_update"] = html_text - return features +# return features def get_esri_geometry_key(geometry): @@ -247,7 +247,7 @@ def main(args): for feature_type in ["points", "lines", "combined", "exploded"]: logger.info(f"Processing {feature_type} features...") features_of_type = all_features[feature_type] - features = handle_status_updates(features_of_type) + features = features_of_type logger.info("Deleting all existing features...") if not args.test: @@ -268,7 +268,7 @@ def main(args): for feature_type in ["points", "lines", "combined", "exploded"]: logger.info(f"Processing {feature_type} features...") features_of_type = all_features[feature_type] - features = handle_status_updates(features_of_type) + features = features_of_type logger.info( f"Deleting all existing features in {feature_type} layer for updated projects in chunks of {UPLOAD_CHUNK_SIZE}..."