custom_fields: Fix confusing comments for do_update_..._if_changed.

d66cbd2832 added these mentioning
"always_notify" for some reason, but always_notify clearly isn't a real
thing in this context so the comments need to be fixed to eliminate this
potential source of confusion.
This commit is contained in:
Mateusz Mandera 2021-05-28 21:49:38 +02:00 committed by Tim Abbott
parent 6702f434ca
commit 932c846454
2 changed files with 2 additions and 2 deletions

View File

@ -7336,7 +7336,7 @@ def do_update_user_custom_profile_data_if_changed(
if not created and field_value.value == str(field["value"]):
# If the field value isn't actually being changed to a different one,
# and always_notify is disabled, we have nothing to do here for this field.
# we have nothing to do here for this field.
# Note: field_value.value is a TextField() so we need to cast field['value']
# to a string for the comparison in this if.
continue

View File

@ -713,7 +713,7 @@ class UpdateCustomProfileFieldTest(CustomProfileFieldTestCase):
with mock.patch("zerver.lib.actions.notify_user_update_custom_profile_data") as mock_notify:
# Attempting to "update" the field value, when it wouldn't actually change,
# if always_notify is disabled, shouldn't trigger notify.
# shouldn't trigger notify.
do_update_user_custom_profile_data_if_changed(iago, data)
mock_notify.assert_not_called()