-
Notifications
You must be signed in to change notification settings - Fork 37
Milestone
Description
specify7/specifyweb/specify/update_locality.py
Lines 405 to 423 in c4f8414
def merge_parse_results(results: list[Union[ParseSuccess, ParseError]], locality_id: int, row_number: int) -> tuple[ParsedRow, list[ParseError]]: | |
to_upload: ParsedRow = { | |
"locality_id": locality_id, | |
"row_number": row_number, | |
"locality": {}, | |
"geocoorddetail": {} | |
} | |
errors = [] | |
for result in results: | |
if isinstance(result, ParseError): | |
errors.append(result) | |
else: | |
to_upload[result.model.lower()].update(result.to_upload) | |
if len(to_upload['geocoorddetail']) == 0: | |
to_upload['geocoorddetail'] = None | |
return to_upload, errors |
Metadata
Metadata
Assignees
Labels
No labels