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

Derek furst/constraints allow non donors #735

Merged
merged 4 commits into from
Sep 5, 2024

Conversation

DerekFurstPitt
Copy link
Contributor

Added a bypass inside metadata_constraints.py in the get_constraints function. The original plan was to do the bypass directly in app.py in the endpoint, but because we need to go a few layers down into the request body to find the entity-type, and both that and the part that sets the response code are located there, it worked out better doing the change here.

now donors will be validated as before (donor must have an organ descendent) but non donors will pass automatically with a "nothing to validate" response like we do elsewhere.

yuanzhou and others added 2 commits August 30, 2024 13:03
…ections-creators-to-contributors

Derek furst/change collections creators to contributors
…n the constraints field. Only donors should be evaluated, everything else passes automatically with a nothing to validate 200 response
Copy link
Member

@yuanzhou yuanzhou left a comment

Choose a reason for hiding this comment

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

@DerekFurstPitt a few things:

  • Since now you are handling the bypass validation in metadata_constraints.py, it makes more sense to also move constraints_json_is_valid() to this module so we keep everything in one module.

  • Due to report_type is no longer needed for HuBMAP, we should remove the unused index variable too.

  • Looks like you are treating all the non-200 codes as 400 error , then what's the point of returning 404 in get_constraints()?

  • Within get_constraints(), the result dict has inconsistent use of name and description. We can get rid of name field and only return code and description otherwise, only need to handle name as part of the endpoint response. Really depends on how you want to handle the final response in app.py

@yuanzhou yuanzhou merged commit 0cd163b into dev-integrate Sep 5, 2024
4 checks passed
@yuanzhou yuanzhou deleted the Derek-Furst/constraints-allow-non-donors branch September 12, 2024 15:06
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.

2 participants