Skip to content

Commit 5c6df64

Browse files
contributions take 'contributor_id' - this fixes #11
1 parent 8ca8880 commit 5c6df64

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

restapi/tests/test_contributions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_workflow(self):
2121
user = self.contract.create_user()
2222

2323
# create a contribution
24-
response = app.post(self.url_collection, {'user_id': user.id})
24+
response = app.post(self.url_collection, {'contributor_id': user.id})
2525
self.assertEqual(response.json['contributor']['id'], user.id)
2626
contribution_id = response.json['id']
2727

restapi/views/contributions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def collection_post(request):
2727
2828
:returns: information about the new contribution
2929
"""
30-
user_id = request.POST['user_id']
30+
user_id = request.POST['contributor_id']
3131
user = request.contract.get_user(user_id)
3232
contribution = request.contract.create_contribution(user=user)
3333
return contribution_to_dict(contribution, request)

0 commit comments

Comments
 (0)