def build_customprofilefields_values( custom_field_map: ZerverFieldsT, fields: ZerverFieldsT, user_id: int, custom_field_id: int, custom_field_values: List[ZerverFieldsT]) -> int: for field, value in fields.items(): custom_field_value = CustomProfileFieldValue(id=custom_field_id, value=value['value']) custom_field_value_dict = model_to_dict( custom_field_value, exclude=['user_profile', 'field']) custom_field_value_dict['user_profile'] = user_id custom_field_value_dict['field'] = custom_field_map[field] custom_field_values.append(custom_field_value_dict) custom_field_id += 1 return custom_field_id
def build_customprofilefields_values(slack_custom_field_name_to_zulip_custom_field_id: ZerverFieldsT, fields: ZerverFieldsT, user_id: int, custom_field_id: int, custom_field_values: List[ZerverFieldsT]) -> int: for field, value in fields.items(): if value['value'] == "": continue custom_field_value = CustomProfileFieldValue( id=custom_field_id, value=value['value']) custom_field_value_dict = model_to_dict(custom_field_value, exclude=['user_profile', 'field']) custom_field_value_dict['user_profile'] = user_id custom_field_value_dict['field'] = slack_custom_field_name_to_zulip_custom_field_id[field] custom_field_values.append(custom_field_value_dict) custom_field_id += 1 return custom_field_id