-
-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invite users to a bounty based on skills #5060
Conversation
left a comment over at #5048 (comment) |
Codecov Report
@@ Coverage Diff @@
## master #5060 +/- ##
=========================================
Coverage ? 18.57%
=========================================
Files ? 206
Lines ? 15985
Branches ? 2162
=========================================
Hits ? 2969
Misses ? 13006
Partials ? 10 Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #5060 +/- ##
==========================================
- Coverage 30.78% 30.75% -0.04%
==========================================
Files 221 221
Lines 17829 17958 +129
Branches 2464 2530 +66
==========================================
+ Hits 5489 5523 +34
- Misses 12114 12195 +81
- Partials 226 240 +14
Continue to review full report at Codecov.
|
45dc8ad
to
4ef41a7
Compare
@danlipert @thelostone-mc When reviewing check the users_fetch_filters also, for some reason github is not showing diff there, but the def was introduced in this PR |
else: | ||
profile_list = Profile.objects.prefetch_related( | ||
'fulfilled', 'leaderboard_ranks', 'feedbacks_got' | ||
).exclude(hide_profile=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh why did we move this from def users_fetch_filters
? to keep that more generic ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be DRY instead of copy paste the same filters, both users filters and bulk invite user users_fetch_filters
to filter and have the same result
app/assets/v2/js/users.js
Outdated
return; | ||
} | ||
vm.issueDetails = undefined; | ||
let getIssue = fetchData(apiUrldetails, 'GET'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
?
app/assets/v2/js/users.js
Outdated
}, | ||
getIssueDetails: function(url) { | ||
let vm = this; | ||
let apiUrldetails = `/actions/api/v0.1/bounties/?github_url=${encodeURIComponent(url)}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just a few comments and some potential fix we'll have to make in the future
@@ -1145,6 +1164,77 @@ def social_contribution_modal(request): | |||
return TemplateResponse(request, 'social_contribution_modal.html', params) | |||
|
|||
|
|||
@csrf_exempt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add the @staff_member_required
decorator here to restrict access?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
humm can be, Im restricting it using request.user.is_staff, seems to me there are plans to do this a feature for users so not sure if worst changing it.
app/dashboard/views.py
Outdated
bounty_invite.bounty.add(bounty) | ||
bounty_invite.inviter.add(inviter) | ||
bounty_invite.invitee.add(profile.user) | ||
# emails.append(profile.email) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover line
# emails.append(profile.email) | ||
try: | ||
msg = request.POST.get('msg', '') | ||
share_bounty([profile.email], msg, inviter.profile, invite_url, False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how many emails we can send within the request-response window before the request times out? I'm guessing this will be somewhat buggy, may have to refactor to use celery soon but for now we'll see since its internal only.
Description
Refers/Fixes
#5045
Testing
Tested locally with all filters, getting emails with invites perfectly according to the query