Skip to content
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

Fix/dashboard prizes #7162

Merged
merged 4 commits into from
Jul 29, 2020
Merged

Conversation

zoek1
Copy link
Contributor

@zoek1 zoek1 commented Jul 29, 2020

Description

@octavioamu asked me to work based on stable

  • sponsors got 404 error when they try to acess the sponsor dashboard

https://www.loom.com/share/d4b7a39bb65f4ffea692aaa927824119

Refers/Fixes

#7158

Testing

@zoek1 zoek1 changed the base branch from master to stable July 29, 2020 09:54
@codecov
Copy link

codecov bot commented Jul 29, 2020

Codecov Report

Merging #7162 into stable will increase coverage by 0.00%.
The diff coverage is 5.40%.

Impacted file tree graph

@@           Coverage Diff           @@
##           stable    #7162   +/-   ##
=======================================
  Coverage   26.21%   26.21%           
=======================================
  Files         296      296           
  Lines       29258    29284   +26     
  Branches     4321     4325    +4     
=======================================
+ Hits         7669     7677    +8     
- Misses      21318    21336   +18     
  Partials      271      271           
Impacted Files Coverage Δ
app/dashboard/views.py 10.46% <5.40%> (-0.03%) ⬇️
app/dashboard/embed.py 31.60% <0.00%> (+3.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8aeb8a...6382169. Read the comment docs.

query_prizes = Bounty.objects.filter(event=hackathon_event)
elif is_sponsor_member.exists():
sponsor = is_sponsor_member.first()
query_prizes = Bounty.objects.filter(event=hackathon_event, bounty_owner_profile=sponsor)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if bounty_owner_profile will the org name? or is always a user profile (not org) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

image
example this is from gitcoin repo but the owner is my personal profile, this query will return prizes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added one more commit to manage this scenario:

  • Will check if you are a member of one sponsor, if so it will display all prizes related to the sponsor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

we really need to add bounty org profile and populate it, asap.

@@ -266,6 +266,7 @@
document.hackathon_id = "{{ hackathon.id | safe }}";
document.hackathonObj = JSON.parse(document.getElementById('hackathon-object').textContent);
document.activePanel = parseInt({{panel | safe}});
document.is_sponsor = {{ is_sponsor|yesno:'true,false' }}
Copy link
Member

Choose a reason for hiding this comment

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

@octavioamu side note -> do wanna attach this to the DOM ?

Copy link
Contributor

@octavioamu octavioamu Jul 29, 2020

Choose a reason for hiding this comment

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

I think yes because then is handled with vuejs to show/hide the dashboard link

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

ohh I see I got confused with isSponsor

@octavioamu octavioamu merged commit 4b8d9b9 into gitcoinco:stable Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants