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

Make Problem.is_accessible_by consistent with Problem.get_visible_problems #1420

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

Ninjaclasher
Copy link
Member

@Ninjaclasher Ninjaclasher commented Jun 2, 2020

The current is_accessible_by check doesn't take into account users who have edit_public_problem or edit_all_problem, or author/curator fields when the user does not have the edit_own_problem permission, while get_visible_problems do. This causes some problems to show up, but when a user clicks on the link, it will lead to a 404 page.

This PR is required to allow the unittests in #1416 to pass (correctly).

@codecov-commenter
Copy link

Codecov Report

Merging #1420 into master will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1420   +/-   ##
=======================================
  Coverage   37.92%   37.92%           
=======================================
  Files         198      198           
  Lines       11339    11339           
=======================================
  Hits         4300     4300           
  Misses       7039     7039           
Impacted Files Coverage Δ
judge/models/problem.py 51.95% <0.00%> (ø)

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 06028a1...dec1605. Read the comment docs.

Copy link
Member

@Xyene Xyene left a comment

Choose a reason for hiding this comment

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

Thanks!

@Xyene Xyene merged commit d8e3ca5 into DMOJ:master Jun 3, 2020
@Ninjaclasher Ninjaclasher deleted the problem-checks branch June 3, 2020 18:47
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.

3 participants