hipchat import: Handle missing emails for guest users.

This commit is contained in:
Steve Howell 2018-10-12 19:49:01 +00:00 committed by Tim Abbott
parent 8accc60ca7
commit 3baac7ddf3

View File

@ -95,6 +95,13 @@ def convert_user_data(raw_data: List[ZerverFieldsT], realm_id: int) -> List[Zerv
short_name = in_dict['mention_name']
timezone = in_dict['timezone']
if not email:
# Hipchat guest users don't have emails, so
# we just fake them.
assert(is_guest)
email = 'guest-{id}@example.com'.format(id=id)
delivery_email = email
date_joined = int(timezone_now().timestamp())
is_active = not in_dict['is_deleted']