-
Notifications
You must be signed in to change notification settings - Fork 4
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
#161966611: Users should rate articles #23
Conversation
authors/apps/articles/views.py
Outdated
except Exception as ex: | ||
response = dict(errors={"message": "There was a problem sending the rating" | ||
" try again later."}) | ||
return Response(response, status=status.HTTP_503_SERVICE_UNAVAILABLE) |
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.
Avoid too many return
statements within this function.
3125f14
to
4ea92d1
Compare
53c462f
to
6cca04f
Compare
- This delivers code to allow users rate articles in the api [Delivers #161966611]
6cca04f
to
7f5a82d
Compare
Code Climate has analyzed commit 7f5a82d and detected 2 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
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.
LGTM
What does this PR do?
The user should be able to rate articles and also see ratings for all the articles in the authorshaven API.
Description of Task to be completed?
The user should be able to rate articles on the authorshaven api. The users should then be able to see the ratings depicted on the articles page when they request for it. The user, in this case an API user authenticated or not should be able to view all ratings of articles.
To rate an article the user must be authenticated first.
How should this be manually tested?
To test the application follow the steps below.
git clone https://github.com/andela/ah-technocrats.git
cd ah-technocrats
git checkout ft-user-rate-articles-161966611
to switch to current branchvirtualenv env -p python3
to create a virtual environment for the applicationsource env/bin/activate
pip install -r requirements.txt
python manage.py test
to testAny background context you want to provide?
What are the relevant pivotal tracker stories?
#161966611
Checklist:
Screenshots
How ratings of articles appear when you view multiple articles
The screen you get when you rate an article
The ratings when viewing a single article have distributions
That is, if ten users rate the article 5 then the distribution will be
{'5': '1'}