Skip to content

[ENG-3898][ENG-3899]ResourceDetail PATCH and DELETE#9991

Merged
jwalz merged 35 commits into
CenterForOpenScience:feature/registration_resourcesfrom
jwalz:resource_patch_delete_api
Jul 28, 2022
Merged

[ENG-3898][ENG-3899]ResourceDetail PATCH and DELETE#9991
jwalz merged 35 commits into
CenterForOpenScience:feature/registration_resourcesfrom
jwalz:resource_patch_delete_api

Conversation

@jwalz
Copy link
Copy Markdown
Contributor

@jwalz jwalz commented Jul 27, 2022

Purpose

Implement PATCH and DELETE methods on the ResourceDetail endpoint

Changes

  • Update ResourceDetailPermission to allow PATCH and DELETE
  • Implement ResourceSerializer.update() to handle PATCHing
  • Implement ResourceDetail.perform_destroy() to handle DELETEing
  • Add EnumFieldMemberError Exception class
    • Raise in EnumField when an unsupported value is encountered
    • Catch in ResourceDetail.patch() to populate the source field
  • Tests

QA Notes

Documentation

Side Effects

Ticket

https://openscience.atlassian.net/browse/ENG-3898
https://openscience.atlassian.net/browse/ENG-3899

Jon Walz added 30 commits July 14, 2022 16:57
Copy link
Copy Markdown
Member

@mfraezz mfraezz left a comment

Choose a reason for hiding this comment

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

A couple questions, but generally looks good. :octocat:

Comment thread api/resources/serializers.py Outdated
Comment thread api/resources/serializers.py Outdated
Comment thread api/resources/views.py
Comment thread osf/models/outcomes.py
Copy link
Copy Markdown
Collaborator

@brianjgeiger brianjgeiger left a comment

Choose a reason for hiding this comment

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

A few questions, maybe one typo.

Comment thread api/resources/serializers.py Outdated
Comment thread api_tests/resources/views/test_resource_detail.py
Comment thread api_tests/resources/views/test_resource_detail.py
Comment thread api_tests/resources/views/test_resource_detail.py Outdated
Copy link
Copy Markdown
Collaborator

@brianjgeiger brianjgeiger left a comment

Choose a reason for hiding this comment

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

Just a couple of tiny things. Otherwise looks good.

Comment thread api/resources/serializers.py Outdated
Comment thread api/resources/serializers.py Outdated
jwalz and others added 2 commits July 28, 2022 09:47
Co-authored-by: Brian J. Geiger <bgeiger@pobox.com>
Co-authored-by: Brian J. Geiger <bgeiger@pobox.com>
@jwalz jwalz merged commit 8868039 into CenterForOpenScience:feature/registration_resources Jul 28, 2022
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