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

When editing votes, GET error is triggered #205

Open
lgelauff opened this issue Jan 9, 2022 · 5 comments
Open

When editing votes, GET error is triggered #205

lgelauff opened this issue Jan 9, 2022 · 5 comments

Comments

@lgelauff
Copy link
Collaborator

lgelauff commented Jan 9, 2022

I'm testing on montage-dev.

Reproduce: Create a campaign, create a round (eg with

  • Images from Wiki Loves Monuments 2017 in Ghana
  • rating
  • no restrictions
  • 1 juror: you

vote a few images. Then click 'edit my votes'. This triggers a GET error. angular.js:12189 GET https://montage-dev.toolforge.org/v1/juror/round/105/votes?offset=7&order_by=date&sort=desc 403

@mahmoud
Copy link
Member

mahmoud commented Jan 13, 2022

Hey Lodewijk! Great find + report. Note that the montage-dev backend (where this error is coming from) is pretty far ahead of production right now (just waiting for international round to wrap so that I can upgrade safely). I see the 403 and am investigating. If there's a blocker on production, let me know as well!

@mahmoud
Copy link
Member

mahmoud commented Jan 13, 2022

Hmm, having more trouble reproducing this as your user. Just checking at the console (mostly a note to my future self):

>>> session.query(Vote).options(joinedload('round_entry')).filter(Vote.user_id == 409, Vote.round_entry.has(round_id=105), Vote.status == COMPLETED_STATUS).order_by(Vote.modified_date.desc()).limit(15).offset(7).all()
[<Vote id=47479 user_id=409>, <Vote id=47482 user_id=409>, ...]

So no explanation yet. If you visit the URL you mentioned (link) directly, what do you see?

@lgelauff
Copy link
Collaborator Author

I get tables with the information, and no errors.

However, 105 doesn't seem to be an active round? Lets try 112. If I then go to the same direct endpoint, I get 403 forbidden ("no complete ratings") while I made sure to have 4 photos rated.

@mahmoud
Copy link
Member

mahmoud commented Jan 13, 2022

Ah, remove the offset=4 from that URL and it'll likely work. I wonder if the frontend is generating the wrong URL in some cases.

@lgelauff
Copy link
Collaborator Author

Yup, that seems to do the trick

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

No branches or pull requests

2 participants