Fix RegisterPassViewSet.destroy logic and add unit tests #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix Logical Error in
RegisterPassViewSet.destroy
Method and Add Corresponding Unit TestsDescription
This pull request addresses an issue in the
RegisterPassViewSet
class where thedestroy
method does not delete a registration when one exists. The current logic incorrectly returns a200 OK
response without performing the deletion. The changes made include:destroy
method to ensure that the registration is deleted when found.destroy
method.Changes Made
Corrected Logic in
destroy
Method:if registration:
toif not registration:
to properly delete the registration if it exists.200 OK
response is returned when no registration exists, as expected.Added Unit Tests:
200 OK
response is returned when the registration does not exist, and ensures that no registrations are deleted accidentally.This commit addresses issue #33.