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

#161966626 report articles #27

Merged
merged 1 commit into from
Dec 14, 2018
Merged

Conversation

actlikewill
Copy link
Contributor

@actlikewill actlikewill commented Dec 13, 2018

What does this pull request do?

Add the password reset feature

Description of the tasks to be completed?

  • add functionality to allow users to report articles with inappropriate content
  • allow admin user to view all article reports

How should this be manually tested?

  • Clone the repo git clone https://github.com/andela/ah-technocrats.git

  • cd ah-technocrats

  • Checkout out to this branch git checkout ft-reporting-articles-161966626

  • Make virtual environment python3 -m venv venv

  • Activate the virtual environment source venv/bin/activate

  • Install all the dependencies from the requirements file pip install -r requirements.txt

  • Make migrations python manage.py makemigrations

  • Apply the migrations python manage.py migrate

  • Run the server python manage.py runserver

  • With a logged in user, create an article

screen1

  • To report an article, send a post request to the following url
    POST/ /api/articles/<slug>/report/
    The <slug> needs to be a valid article slug
    The format of the post data is as follows:

    {"report": 2}

The integer value passed to the report data corresponds to a preset list of possible reportable violations

screen2

  • To view the submitted reports login as an admin and make a GET request to the endpoint
    GET / api/articles/reports/

screen3

Any background context you want to provide?

  • Users require a way to report articles that have inappropriate content for the site admins to take actions.

What are the relevant Pivotal Tracker Stories

#161966626

Checklist:

  • My code follows the style guidelines of this project
  • At least 2 people have reviewed my PR
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • My PR has one commit.

@actlikewill actlikewill added the WIP Work In Progress label Dec 13, 2018

Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

@actlikewill actlikewill force-pushed the ft-reporting-articles-161966626 branch from f2f22aa to 4a52bba Compare December 13, 2018 13:56
@actlikewill actlikewill changed the title feat(report): report articles #161966626 report articles Dec 13, 2018
@actlikewill actlikewill force-pushed the ft-reporting-articles-161966626 branch from 4a52bba to e1b602d Compare December 13, 2018 19:00
@actlikewill actlikewill removed the WIP Work In Progress label Dec 13, 2018
@actlikewill actlikewill force-pushed the ft-reporting-articles-161966626 branch from e1b602d to 7e4c486 Compare December 14, 2018 06:01
Mnickii
Mnickii previously approved these changes Dec 14, 2018
Copy link

@Mnickii Mnickii left a comment

Choose a reason for hiding this comment

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

LGTM

- add endpoint for reporting articles
- add endpoint for getting reported articles

[#161966626]
@codeclimate
Copy link

codeclimate bot commented Dec 14, 2018

Code Climate has analyzed commit 98b445f and detected 0 issues on this pull request.

View more on Code Climate.

Copy link

@Mnickii Mnickii left a comment

Choose a reason for hiding this comment

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

LGTM

@Mnickii Mnickii merged commit 7a97257 into develop Dec 14, 2018
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.

None yet

2 participants