Skip to content

Commit

Permalink
Add slack user information the project api (#440)
Browse files Browse the repository at this point in the history
* Add slack information to the assignment serializer

* Update a related test

* Remove test fixes

* Fix the tests
  • Loading branch information
paopow committed Feb 2, 2018
1 parent b6f480c commit 6e66072
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def test_project_information_api(self):
'first_name': assignment.worker.user.first_name,
'last_name': assignment.worker.user.last_name,
'id': assignment.worker.id,
'slack_username': assignment.worker.slack_username,
'slack_user_id': assignment.worker.slack_user_id
},
'iterations': [
{
Expand Down
4 changes: 4 additions & 0 deletions orchestra/project_api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,16 @@ def get_worker(self, obj):
'username': None,
'first_name': None,
'last_name': None,
'slack_username': None,
'slack_user_id': None
}
return {
'id': obj.worker.id,
'username': obj.worker.user.username,
'first_name': obj.worker.user.first_name,
'last_name': obj.worker.user.last_name,
'slack_username': obj.worker.slack_username,
'slack_user_id': obj.worker.slack_user_id
}

def get_status(self, obj):
Expand Down
4 changes: 4 additions & 0 deletions orchestra/project_api/tests/test_project_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ def delete_keys(obj):
'username': self.workers[0].user.username,
'first_name': self.workers[0].user.first_name,
'last_name': self.workers[0].user.last_name,
'slack_username':
self.workers[0].slack_username,
'slack_user_id':
self.workers[0].slack_user_id
},
'iterations': [{
'status': 'Requested Review',
Expand Down

0 comments on commit 6e66072

Please sign in to comment.