mumbleapi icon indicating copy to clipboard operation
mumbleapi copied to clipboard

Block user feature

Open Girik1105 opened this issue 3 years ago • 0 comments

Describe your changes :

In users/views.py -> Added Block User view, altered user_mumbles and user_article views so they don't show if an user is blocked. Altered following view so that they can't follow someone if they are blocked

in users/urls.py -> Added endpoint /api/users/{username}/block/

in users/models.py -> Added blocked_users ManyToMany Field in userprofile model.

In feed/views.py -> Changed Mumbles view so that it does not show the mumbles of users that have blocked or have been blocked.


#171

This feature allows users to block other users if they don't want to see a person's mumbles, articles, profiles. It also allows users to block someone if they don't want a user to see their mumbles, articles or profile.

User A blocks User B

User B cannot find user A's profile, mumbles or articles. His feed will stop showing User A's mumbles. User B will not be able to follow user A

User A will be able to find User A's profile, but only to unblock, User A will not be able to see User B's mumbles, articles or profile until he unblocks

Type of change :

  • [x] New Feature

Preview (Screenshots) :

I have 2 users my account and Test

I can see test's mumbles

This is mumbles list

I block test from my account

I will have to unblock to see their mumbles/articles again

This is mumbles list but I cannot see Test2 mumbles as he has been blocked

From Test user's account I cannot view my mumbles, articles as test has been blocked from my account

From Test user's account I cannot find my profile as test has been blocked from my account

Checklist:

  • [x] I have read the Code Of Conduct document.
  • [x] I have read the CONTRIBUTING document.
  • [x] I have performed a self-review of my own.
  • [x] I have tagged my reviewers below.
  • [x] I have commented my code, particularly in hard-to-understand areas.
  • [x] My changes generate no new warnings.
  • [ ] I have added tests that prove my fix is effective or that my feature works.
  • [x] All new and existing tests passed.

Reviewers

@PraveenMalethia @MidouWebDev

Girik1105 avatar Jun 10 '21 07:06 Girik1105