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

API: Raise 404 on Org Views when doesn't exist, and other fixes #184

Merged
merged 8 commits into from
Feb 26, 2024

Conversation

R2ZER0
Copy link
Contributor

@R2ZER0 R2ZER0 commented Feb 22, 2024

This PR is a result of review change requests from #178, #179, #181 and #183, but collates the changes here to avoid complicated rebasing.

This PR:

  • Fixes a bug in the OrgDetailView, so that it will 404 when an Org is not found.
  • Changes 404 behaviour of the org grants views to match the detail view, i.e. if the Org doesn't exist in DB, then 404 (instead of returning an empty list).
  • Adds an exists() method to the Organisation pseudo-model to facilitate this feature, plus tests.
  • Adds tests for endpoint behaviour when a non-existent Org ID is given.
  • Adds tests for Organisation.get()
  • Change relative imports for absolute imports

@R2ZER0 R2ZER0 requested review from michaelwood and removed request for michaelwood February 22, 2024 17:37
@R2ZER0 R2ZER0 marked this pull request as draft February 22, 2024 17:41
@R2ZER0 R2ZER0 force-pushed the rg/api-fix-grantsview-404-behaviour branch from 02c7910 to cd5ef8e Compare February 22, 2024 17:45
@R2ZER0 R2ZER0 changed the base branch from rg/api-schema-3 to rg/org-api-tests February 22, 2024 17:46
@R2ZER0 R2ZER0 force-pushed the rg/api-fix-grantsview-404-behaviour branch from cd5ef8e to 5d55897 Compare February 22, 2024 18:20
The OrgDetail view wasn't properly handling object-not-found errors.
Example OrgIDs should start with prefix XE-EXAMPLE
Replace relative imports with absolute imports
@R2ZER0 R2ZER0 changed the title api: Raise 404 on GrantsView if Org doesn't exist api: Raise 404 on GrantsView if Org doesn't exist, and other fixes Feb 22, 2024
@R2ZER0 R2ZER0 changed the title api: Raise 404 on GrantsView if Org doesn't exist, and other fixes api: Raise 404 on Org Views when doesn't exist, and other fixes Feb 22, 2024
@R2ZER0 R2ZER0 changed the title api: Raise 404 on Org Views when doesn't exist, and other fixes API: Raise 404 on Org Views when doesn't exist, and other fixes Feb 22, 2024
@R2ZER0 R2ZER0 marked this pull request as ready for review February 22, 2024 18:43
@R2ZER0 R2ZER0 merged commit 2928b7d into rg/org-api-tests Feb 26, 2024
6 checks passed
@R2ZER0 R2ZER0 deleted the rg/api-fix-grantsview-404-behaviour branch March 8, 2024 12:42
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.

None yet

2 participants