This was broken, due the mechanism simply using our
is_guest/is_realm_admin/etc. role setters, but failing to adjust system
group memberships - resulting in corrupted database state.
We need to ensure that change_user_role is called for setting user role.
There are two relevant codepaths that run the sync based on
AUTH_LDAP_USER_FLAGS_BY_GROUP and thus need to get this right:
1. manage.py sync_ldap_user_data
2. Just-in-time user creation when a user without a Zulip account logs
in for the first using their ldap credentials. After
get_or_build_user returns, django-auth-ldap sees that the user
account has just been created, and proceeds to run ._populate_user().
Now that both user.save() and do_change_user_realm will be getting
called together, we need to ensure this always happens atomically.
This imposes the need to override _get_or_create_user to put it in a
transaction. The troublesome consequence is that this new
`atomic(savepoint=False)` causes the usual type of issue, where tests
testing error get their transaction rolled back and cannot continue
executing.
To get around that, we add a test helper
`artificial_transaction_savepoint` which allows these tests to wrap
their problematic blocks in an artificial transaction which provides a
savepoint, thus preventing the full test transaction rollback derailing
the rest of the test.
Without these overrides, we cannot test the functionality in DEVELOPMENT
and TESTING.
There are two codepaths that we're covering here:
1. The sync which happens via `sync_ldap_user_data`.
2. The sync which happens during just-in-time user creation upon first
login via ldap.
Both codepaths end up triggering ldap_user._get_or_create_user().
The banner grid layout for the medium and small variants has 4 rows,
while the previously described `grid-template-areas` only had the
placement information for the first 3 rows.
This commit adds the spatial description of the banner elements in the
the final row, fixing the alignment of the banner elements in the cases
where there are no action buttons and only the banner label.
We consider all inaccessible users as active so this commit
fixes is_active_user_for_popover accordingly.
This fixes deactivated icon showing in message avatar for
inaccessible users even when they are active.
Since inbox only has unread topics visible, rows having no
unread counter was not handled. Added that support so that
inbox style channel view can use it.
To avoid styles for left sidebar topics list from applying to
inbox view style channel view, we need to be able to use different
classes for the topic list wrapper element.
This commit makes some fine adjustments to the layout of the banners,
- The padding of the banner label is adjusted such that the height of
the banner label is equal to the height of the banner action button.
This ensures that these banner children elements are vertically
aligned while allowing for multi-line banner labels.
- Removes the extra margin used previously for aligning the banner
action buttons.
- The padding of the banner close button is also adjusted to match the
height of the banner, as a result of the other padding adjustments.
Fixes: #32934
Follow up to PR zulip#33097
Also add test cases to make sure a silent mention alone doesn't fetch
group membership, but non-silent mention does and always takes precedence.
Instead of adding group as a subgroup, we now provide option
to add direct members and direct subgroups of a group to a
user group by providing an expand button in the group pill.
Fixes#32335.
We previously showed "Everyone except guests" group at the
top for group members and stream subscribers typeahead. It
makes sense for stream subscribers typeahead but not for
group members typeahead, so this commit fixes that.
d11537a8cd modified how we sort options in typeahead for stream
subscribers and group members. The function names added in that
commit were confusing since the names included "settings" when
the function is used to sort the typehead for adding and updating
stream subscribers and group members. This commit fixes the names
of these functions.
This commit also renames sort_setting_options since that function
is now used for adding and updating stream subscribers and group
members apart from being used for sorting typeahead for group
settings.
Since set_up_combined was only being called with
is_stream_subscriber_input as true, there is no
need to have this variable in opts as we use same
sorting function for all the cases.
Until the owner of a demo organization sets an email, the submit
button on the invite user modal is now disabled.
The input div for email addresses is also disabled, which wasn't
disabled before because it's not an input element on the form.
In the invite users modal, if the demo organization owner hasn't
yet added an email to their account, hide the banners with tips
for setting up organization information before inviting users.
This just records the time when the user created the
request to schedule a message or set a reminder.
This would be unused but is future-proofing against a world
where we decide to edit the strings or UI to show when you
asked for the thing.
The huddle database table was renamed to direct_message_group.
This commit updates all references to huddle in the missed_message
email templates and locale files.
Fetching a subscription and then checking if it exists was taking too
much space in a test and making it feel convoluted. We're planning to
check it more in future commits.
Use a shared error template for demo organizations when rendering
the upgrade or sponsorship pages.
Demo organizations must be converted into a permanent organization,
i.e., not be automatically scheduled for deletion, to either apply
for a sponsorship/discount or upgrade to a paid plan.