diff --git a/app/assets/v2/js/pages/bounty_share.js b/app/assets/v2/js/pages/bounty_share.js index a047d661471..fa7a47099e8 100644 --- a/app/assets/v2/js/pages/bounty_share.js +++ b/app/assets/v2/js/pages/bounty_share.js @@ -21,7 +21,7 @@ $('.modal-link').click(function(e) { const sendInvites = (users) => { let usersId = []; let msg = $('#shareText').val(); - const url = document.issueURL; + const bountyId = document.result.pk; $.each(users, function(index, elem) { usersId.push(elem.id); @@ -30,7 +30,7 @@ const sendInvites = (users) => { var sendEmail = fetchData( '/api/v0.1/social_contribution_email/', 'POST', - {usersId, msg, url, invite_url}, + {usersId, msg, bountyId, invite_url}, {'X-CSRFToken': csrftoken} ); diff --git a/app/assets/v2/js/users.js b/app/assets/v2/js/users.js index d6aa1819800..1b612ec4206 100644 --- a/app/assets/v2/js/users.js +++ b/app/assets/v2/js/users.js @@ -105,7 +105,7 @@ Vue.mixin({ let postInvite = fetchData( apiUrlInvite, 'POST', - { 'url': bounty.github_url, 'usersId': [user], 'bountyId': bounty.id}, + { 'usersId': [user], 'bountyId': bounty.id}, {'X-CSRFToken': csrftoken} ); diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 4825a9956ca..93965f4f86e 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -1136,14 +1136,13 @@ def social_contribution_email(request): emails = [] user_ids = request.POST.getlist('usersId[]', []) - url = request.POST.get('url', '') invite_url = request.POST.get('invite_url', '') + bounty_id = request.POST.get('bountyId') if not invite_url: - bounty_id = request.POST.get('bountyId') invite_url = f'{settings.BASE_URL}issue/{get_bounty_invite_url(request.user.username, bounty_id)}' inviter = request.user if request.user.is_authenticated else None - bounty = Bounty.objects.current().get(github_url=url) + bounty = Bounty.objects.current().get(id=int(bounty_id)) for user_id in user_ids: profile = Profile.objects.get(id=int(user_id)) bounty_invite = BountyInvites.objects.create(