zerver/lib/actions.py: Fix return values.

This commit is contained in:
Eklavya Sharma
2016-05-26 16:57:00 +05:30
committed by Tim Abbott
parent dc060248b4
commit a2b48f05e5

View File

@@ -108,7 +108,7 @@ def bot_owner_userids(user_profile):
user_profile.default_sending_stream and user_profile.default_sending_stream.invite_only or user_profile.default_sending_stream and user_profile.default_sending_stream.invite_only or
user_profile.default_events_register_stream and user_profile.default_events_register_stream.invite_only) user_profile.default_events_register_stream and user_profile.default_events_register_stream.invite_only)
if is_private_bot: if is_private_bot:
return (user_profile.bot_owner_id,) return (user_profile.bot_owner_id,) # TODO: change this to list instead of tuple
else: else:
return active_user_ids(user_profile.realm) return active_user_ids(user_profile.realm)
@@ -290,7 +290,7 @@ def user_sessions(user_profile):
if get_session_user(s) == user_profile.id] if get_session_user(s) == user_profile.id]
def delete_session(session): def delete_session(session):
return session_engine.SessionStore(session.session_key).delete() session_engine.SessionStore(session.session_key).delete()
def delete_user_sessions(user_profile): def delete_user_sessions(user_profile):
for session in Session.objects.all(): for session in Session.objects.all():
@@ -475,8 +475,6 @@ def do_deactivate_stream(stream, log=True):
streams=[stream_dict]) streams=[stream_dict])
send_event(event, active_user_ids(stream.realm)) send_event(event, active_user_ids(stream.realm))
return
def do_change_user_email(user_profile, new_email): def do_change_user_email(user_profile, new_email):
old_email = user_profile.email old_email = user_profile.email
user_profile.email = new_email user_profile.email = new_email
@@ -1034,7 +1032,7 @@ def validate_user_access_to_subscribers(user_profile, stream):
* The stream is invite only, requesting_user is passed, and that user * The stream is invite only, requesting_user is passed, and that user
does not subscribe to the stream. does not subscribe to the stream.
""" """
return validate_user_access_to_subscribers_helper( validate_user_access_to_subscribers_helper(
user_profile, user_profile,
{"realm__domain": stream.realm.domain, {"realm__domain": stream.realm.domain,
"realm_id": stream.realm_id, "realm_id": stream.realm_id,