add delete post functionality and setup project#23
Open
mudassir-jmi wants to merge 1 commit intoMeNsaaH:masterfrom
Open
add delete post functionality and setup project#23mudassir-jmi wants to merge 1 commit intoMeNsaaH:masterfrom
mudassir-jmi wants to merge 1 commit intoMeNsaaH:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces two main enhancements to the project:
Delete Post Functionality:
Added the ability for users to delete posts.
Included necessary views, templates, and URLs to support this feature.
Ensured proper authorization checks so that only the post owner can delete their posts.
Form Validation for Adding Posts:
Implemented validation in the add post form to prevent users from submitting blank posts.
Added error messages and user feedback to guide users in providing necessary content before submission.
Changes Made:
Created a delete view in views.py.
Updated urls.py to include the delete post URL pattern.
Modified templates to include delete post buttons/links.
Added form validation logic to the add post form in forms.py or directly in the template, ensuring posts are not empty.
Updated unit tests to cover the new functionality and validation.
Testing:
Manually tested the delete functionality to confirm that posts are correctly deleted and proper authorization is enforced.
Manually tested the add post form to ensure that blank posts cannot be submitted and appropriate error messages are displayed.