import: Build Reaction with the model class.

This commit is contained in:
Rhea Parekh
2018-08-18 00:05:00 +05:30
committed by Tim Abbott
parent a5bc701181
commit d98a5925cb

View File

@@ -689,15 +689,19 @@ def build_reactions(reaction_list: List[ZerverFieldsT], reactions: List[ZerverFi
continue continue
for user in slack_reaction['users']: for user in slack_reaction['users']:
reaction = dict( reaction = Reaction(
id=reaction_id, id=reaction_id,
emoji_code=emoji_code, emoji_code=emoji_code,
emoji_name=emoji_name, emoji_name=emoji_name,
message=message_id, reaction_type=reaction_type)
reaction_type=reaction_type,
user_profile=added_users[user]) reaction_dict = model_to_dict(reaction,
exclude=['message', 'user_profile'])
reaction_dict['message'] = message_id
reaction_dict['user_profile'] = added_users[user]
reaction_id += 1 reaction_id += 1
reaction_list.append(reaction) reaction_list.append(reaction_dict)
return reaction_id return reaction_id
def build_uploads(user_id: int, realm_id: int, email: str, fileinfo: ZerverFieldsT, s3_path: str, def build_uploads(user_id: int, realm_id: int, email: str, fileinfo: ZerverFieldsT, s3_path: str,