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 non-existent resource report raise 404 #11778

Open
wants to merge 3 commits into
base: dev/7.6.x
Choose a base branch
from

Conversation

whatisgalen
Copy link
Member

@whatisgalen whatisgalen commented Feb 10, 2025

…re #11772

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

Issues Solved

Closes #

Checklist

  • I targeted one of these branches:
    • dev/8.0.x (under development): features, bugfixes not covered below
    • dev/7.6.x (main support): regressions, crashing bugs, security issues, major bugs in new features
    • dev/6.2.x (extended support): major security issues, data loss issues
  • I added a changelog in arches/releases
  • I submitted a PR to arches-docs (if appropriate)
  • Unit tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • My test fails on the target branch

Accessibility Checklist

Developer Guide

Topic Changed Retested
Color contrast
Form fields
Headings
Links
Keyboard
Responsive Design
HTML validation
Screen reader

Ticket Background

  • Sponsored by:
  • Found by: @
  • Tested by: @
  • Designed by: @

Further comments

@whatisgalen whatisgalen changed the title put Resource orm query in try/except Resource.DoesNotExist handling, … Make non-existent resource report raise 404 Feb 10, 2025
@whatisgalen whatisgalen requested a review from chiatt February 10, 2025 18:17
@chiatt chiatt self-assigned this Feb 12, 2025
Copy link
Member

@chiatt chiatt left a comment

Choose a reason for hiding this comment

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

Could you add a changelog entry?

response = self.client.get(url)
self.assertEqual(response.status_code, 200)

def test_resource_report_bad(self):
Copy link
Member

Choose a reason for hiding this comment

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

Because test_resource_report_good tests if the status is 200, that name makes sense. In this case though, I think what's being tested isn't whether the response is bad (which I would take to mean a 500) but rather whether it's missing. So I think more intuitive name would be test_resource_report_for_missing_resource or something like that.

Copy link
Member

@chiatt chiatt left a comment

Choose a reason for hiding this comment

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

There are other places where this should probably be applied as well such as the resource editor, but that could be done is a different PR.

@jacobtylerwalls
Copy link
Member

This issue is already fixed in 8.0. Does it qualify for a 7.6 fix?

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.

Return a 404 when /report/ or /resource/ doesn't lead to an existing resource
3 participants