Skip to content

Commit

Permalink
support for submitting msft hackathon bounties http://bits.owocki.com…
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Apr 17, 2019
1 parent 40cef90 commit 3a414b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/assets/v2/js/pages/fulfill_bounty.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ window.onload = function() {
};

// Get bountyId from the database
var uri = '/api/v0.1/bounties/?github_url=' + issueURL + '&network=' + $('input[name=network]').val() + '&standard_bounties_id=' + $('input[name=standard_bounties_id]').val();
var uri = '/api/v0.1/bounties/?event_tag=all&github_url=' + issueURL + '&network=' + $('input[name=network]').val() + '&standard_bounties_id=' + $('input[name=standard_bounties_id]').val();

$.get(uri, function(results, status) {
results = sanitizeAPIResults(results);
Expand Down
13 changes: 8 additions & 5 deletions app/dashboard/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,14 @@ def get_queryset(self):
# filtering
event_tag = self.request.query_params.get('event_tag', '')
if event_tag:
try:
evt = HackathonEvent.objects.filter(slug__iexact=event_tag).latest('id')
queryset = queryset.filter(event__pk=evt.pk)
except HackathonEvent.DoesNotExist:
return Bounty.objects.none()
if event_tag == 'all':
pass
else:
try:
evt = HackathonEvent.objects.filter(slug__iexact=event_tag).latest('id')
queryset = queryset.filter(event__pk=evt.pk)
except HackathonEvent.DoesNotExist:
return Bounty.objects.none()
else:
queryset = queryset.filter(event=None)

Expand Down

1 comment on commit 3a414b6

@owocki
Copy link
Contributor Author

@owocki owocki commented on 3a414b6 Apr 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context

in the retrospective, i'd like to talk about how we can prevent bugs like this in the future!

cc @danlipert @thelostone-mc @octavioamu @SaptakS

Please sign in to comment.