JSON keys must be strings, and orjson enforces this. Mypy didn’t
catch the mismatched type of profiles_by_user_id because it doesn’t
understand CustomProfileFieldValue.field_id.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
It doesn’t end well. Or sometimes it doesn’t end (OverflowError:
Maximum recursion level reached).
Introduced by commits ccdf52fef6 and
94d2de8b4a (#15601).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This is a prep commit for changing the bots list page to show
normal user popover instead of extended profile one.
This is added so that any open popovers are closed, if one
tries to close the overlay.
This was not needed previously because we were using modal for
showing extended user profile. Now as we would be adding popover,
we would need this to close the open popovers before closing overlay.
This commit renames the show_user_info_popover function to
show_user_info_popover_for_message, as it is used to open
the popover for users which are essentially related to a
particular message, like message sender and mentioned user.
This section referenced the old Puppet path for
puppet/zulip/templates/nginx/upstreams.conf.template.erb, and overall
felt focused on naming files that developers never look at.
We also just make the test express what's actually
happening in the code; we just pass the entire
"exports" section of the event to the settings code
and let it do its thing.
We should send PATCH request for changing stream description only if
it is actually changed, there is no need to send request to backend
if the description is not changed.
We shoudl only send PATCH request to API for stream rename only if
stream name is actually changed.
Previously, when trying to save the stream name without actually
changing it, backend returned 400 with error as "Stream already
has that name". Ideally, we should not make PATCH request if name
is not changed and it should just close the edit widget.
This commit solves this bug.
I’m going to assume that this is not intended to be an optimization
for “WekBit” and can, in fact, be deleted.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Commit abbd8a7f45 (#13112) should have
removed the nonexistent user-drag property rather than the
Webkit-specific -webkit-user-drag property.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit changes change_stream_privacy function to only
send the values of changed settings to backend.
We also avoid sending PATCH request if none of the settings
in stream privacy modal are changed.
This change also fixes the bug in changing stream permissions
for realms with limited plans.
Fixes#16024.
Our intent throughout the codebase is to treat email
case-insensitively.
The only codepath affected by this bug is remote_user_sso, as that's the
only one that currently passes potentially both a user_profile and
ExternalAuthDataDict when creating the ExternalAuthResult. That's why we
add a test specifically for that codepath.
We follow the naming convention.
I also arbitrarily assign the "op" of
"add" to the attachment event, even
though we don't meaningfully test it.
The situation with attachment from the
dispatch test point of view is that
we just want to test that the one line
of code that calls into attachments_ui
(for all three ops) does get dispatched
correctly. We eventually want to get
deeper coverage there, but attachments_ui
wasn't written in the most test-friendly
way. I think it might actually be easy
to fix up attachments_ui to make it a
bit easier to test, but it's out of the
scope of my current PR.
The benefit here is check-node-fixtures
now gives a more concrete plan for
moving schemas to event_schema.py.
We extract test_realm_emojis, and we make
the name of the event more explicit (adding
the __update suffix).
We also add the "op" of "update" here, which
is sort of a quirk of the api, since we don't
actually have alternatives like add/remove,
and therefore the current frontend code doesn't
look at the "op", and thus the original tests
never had to provide a correct value for it.