-
Notifications
You must be signed in to change notification settings - Fork 3
#159082379 A User Should Be Able To Create article #22
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
Conversation
474b7a9 to
22c8987
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This looks good, it just needs to clean up
- Also you can provide more clarity on what you did
authors/apps/articles/renderers.py
Outdated
| pass | ||
| # As mentioned about, we will let the default JSONRenderer handle | ||
| # rendering errors. | ||
| # return super(UserJSONRenderer, self).render(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Is this Commented code
- I think you should return the line
return super(ArticlesJSONRenderer, self).render(data)
I think what that does is return the actual error if the class'srender()itself has an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for Identifying that @ssewilliam, Sharp eye there! I will work on it asap.
authors/apps/articles/models.py
Outdated
| updatedAt = models.DateTimeField(auto_now=True) | ||
|
|
||
| # This makes identifies the owner of the publication | ||
| user = models.ForeignKey(User, on_delete=models.CASCADE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You could have also called this
userasuser_id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will work on that as soon as possible.
| self.article_to_create = { | ||
| "article": { | ||
| "title": "hahahhaha hahaha hahah ahhah", | ||
| "body": "<p>this is a body that is here hahahhahaha\n <p", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abulojoshua1
Can you clarify on why you are passing in raw HTML here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is some data to be used in the test and it should be okay to write some raw html @ssewilliam , maybe @abulojoshua1 could also say something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to mimic the presence on an article that has HTML attributes like Bolding, paragraphs, etc in an article body. But as for now, that for tests.
22c8987 to
076f9ce
Compare
authors/apps/articles/models.py
Outdated
| published = models.BooleanField(default=False) | ||
|
|
||
| # this takes the time stamp of when the article was made | ||
| createdAt = models.DateTimeField(auto_now_add=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use underscores for variable naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, @geofrocker. I will do that ASAP.
67e45c4 to
864a4ce
Compare
864a4ce to
31c48fa
Compare
What does this PR do?
Description of Task to be completed?
How should this be manually tested?
/api/articles/{ "article": { "title": "THE ARTICLE TITLE", "body": "THE ARTICLE BODY", "description": "THE ARTICLE DESCRIPTION" } }Any background context you want to provide?
articles.What are the relevant pivotal tracker stories?