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

🚀 Adding Create Post Form #91

Merged
merged 5 commits into from
Apr 27, 2022
Merged

Conversation

paOmer
Copy link
Collaborator

@paOmer paOmer commented Apr 12, 2022

Added a post creation form to let users have the ability to publish posts.
Used django CreateView class.

  • Added a CreateView for a new post.
  • Added a redirection function on the post model to be used after creating new post.
  • Set the post creation page url.
  • Added a post creation html template.
  • Added relevant tests.

I tried to not include the post creation html template in this PR in order to not include UI but I had to set a html page for testing purposes.

Future tasks:

Close #92

@Yarboa
Copy link
Contributor

Yarboa commented Apr 13, 2022

Added a post creation form to let users have the ability to publish posts. Used django CreateView class.

  • Added a CreateView for a new post.
  • Added a redirection function on the post model to be used after creating new post.
  • Set the post creation page url.
  • Added a post creation html template.
  • Added relevant tests.

I tried to not include the post creation html template in this PR in order to not include UI but I had to set a html page for testing purposes.

Future tasks:

Please add an Issue here

  • Adding the ability to create a job-offer post
  • Adding a link to the create new post form
  • Style the form using crispy-forms

Close #92

@paOmer
Copy link
Collaborator Author

paOmer commented Apr 13, 2022

Added a post creation form to let users have the ability to publish posts. Used django CreateView class.

  • Added a CreateView for a new post.
  • Added a redirection function on the post model to be used after creating new post.
  • Set the post creation page url.
  • Added a post creation html template.
  • Added relevant tests.

I tried to not include the post creation html template in this PR in order to not include UI but I had to set a html page for testing purposes.
Future tasks:

Please add an Issue here

  • Adding the ability to create a job-offer post
  • Adding a link to the create new post form
  • Style the form using crispy-forms

Close #92

Created the issues and edited this PR description to include them.

@paOmer paOmer requested a review from Yarboa April 13, 2022 18:21
@paOmer paOmer requested a review from ShirleyFichman April 14, 2022 12:53
Copy link
Collaborator

@ShirleyFichman ShirleyFichman left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@DeanBiton DeanBiton left a comment

Choose a reason for hiding this comment

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

LGTM

@paOmer paOmer force-pushed the post_create_view branch from 9a02232 to c127152 Compare April 19, 2022 17:14
@paOmer paOmer force-pushed the post_create_view branch 2 times, most recently from f39dbc9 to 8c747bb Compare April 20, 2022 15:53
@paOmer paOmer requested a review from Yarboa April 20, 2022 15:56
@paOmer paOmer force-pushed the post_create_view branch from 8c747bb to 246e327 Compare April 20, 2022 20:38
Copy link
Contributor

@Yarboa Yarboa left a comment

Choose a reason for hiding this comment

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

@paOmer Nice work, I just do not see any client tests in the PR.
When we test View/Form it is not guaranteed the the hole path is not broken
from http request to http response

Setting up the post creation view using django CreateView build-in class.
Setting the post author to be the logged in user.
Requiring a logged in user in order to create new post.
Setting a login url to redirect logged out users.
@paOmer paOmer force-pushed the post_create_view branch from 246e327 to 96a9730 Compare April 23, 2022 09:47
When using the CreateView class, a get_absolute_url function needs to
be created in order for Django to know where to redirect after creation.
@paOmer paOmer force-pushed the post_create_view branch from 96a9730 to b51b7f6 Compare April 23, 2022 10:20
@paOmer paOmer force-pushed the post_create_view branch from b51b7f6 to be4cce5 Compare April 23, 2022 10:25
@paOmer
Copy link
Collaborator Author

paOmer commented Apr 23, 2022

@paOmer Nice work, I just do not see any client tests in the PR. When we test View/Form it is not guaranteed the the hole path is not broken from http request to http response

Thanks,
Updated the tests accordingly.

@paOmer paOmer requested a review from Yarboa April 23, 2022 10:30
Copy link
Contributor

@Yarboa Yarboa left a comment

Choose a reason for hiding this comment

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

LGTM

@Yarboa Yarboa merged commit ccbf205 into redhat-beyond:main Apr 27, 2022
@paOmer paOmer deleted the post_create_view branch April 27, 2022 08:37
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.

🚀 Adding Create Post Form
4 participants