def METHOD_NAME(self, field: str, cleaned_data) -> Optional[str]:
    value = cleaned_data.get(field, "")
    if not value:
        self.add_dynamically_required_error(field)
    else:
        assert isinstance(value, str)
    return value