mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 09:27:43 +00:00
settings_users: Support guest user in admin-user-table.
This supports guest user in the user-info-form-modal as well as in the role section of the admin-user-table. With some fixes by Tim Abbott and Shubham Dhama.
This commit is contained in:
committed by
Tim Abbott
parent
553c50ebfb
commit
d5df0377cc
@@ -482,6 +482,7 @@ def notify_created_user(user_profile: UserProfile) -> None:
|
||||
avatar_url=avatar_url(user_profile),
|
||||
timezone=user_profile.timezone,
|
||||
date_joined=user_profile.date_joined.isoformat(),
|
||||
is_guest=user_profile.is_guest,
|
||||
is_bot=user_profile.is_bot)) # type: Dict[str, Any]
|
||||
if not user_profile.is_bot:
|
||||
event["person"]["profile_data"] = {}
|
||||
@@ -3175,6 +3176,16 @@ def do_change_is_admin(user_profile: UserProfile, value: bool,
|
||||
is_admin=value))
|
||||
send_event(event, active_user_ids(user_profile.realm_id))
|
||||
|
||||
def do_change_is_guest(user_profile: UserProfile, value: bool) -> None:
|
||||
user_profile.is_guest = value
|
||||
user_profile.save(update_fields=["is_guest"])
|
||||
event = dict(type="realm_user", op="update",
|
||||
person=dict(email=user_profile.email,
|
||||
user_id=user_profile.id,
|
||||
is_guest=value))
|
||||
send_event(event, active_user_ids(user_profile.realm_id))
|
||||
|
||||
|
||||
def do_change_stream_invite_only(stream: Stream, invite_only: bool,
|
||||
history_public_to_subscribers: Optional[bool]=None) -> None:
|
||||
history_public_to_subscribers = get_default_value_for_history_public_to_subscribers(
|
||||
|
||||
Reference in New Issue
Block a user