mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 12:33:40 +00:00
slack import: Fix empty values for custom profile fields.
The Slack import process would incorrectly issue CustomProfileFieldValue entries with a value of "" for users who didn't have a given CustomProfileField (especially common for the "skype" and "phone" fields). This had no user-visible effect, but certainly added some clutter in the database.
This commit is contained in:
@@ -263,6 +263,9 @@ def build_customprofilefields_values(custom_field_map: ZerverFieldsT, fields: Ze
|
||||
user_id: int, custom_field_id: int,
|
||||
custom_field_values: List[ZerverFieldsT]) -> int:
|
||||
for field, value in fields.items():
|
||||
if value['value'] == "":
|
||||
# Skip writing entries for fields with an empty value
|
||||
continue
|
||||
custom_field_value = CustomProfileFieldValue(
|
||||
id=custom_field_id,
|
||||
value=value['value'])
|
||||
|
||||
Reference in New Issue
Block a user