Skip to content
Snippets Groups Projects
Unverified Commit f8b7c2b9 authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #2466 from HyphaApp/fix/gh-2461-applicant-activity-feed

Fix Applicant Activity Feed(Review)
parents c0db6be0 345c5cb1
No related branches found
No related tags found
No related merge requests found
...@@ -266,6 +266,7 @@ class ActivityAdapter(AdapterBase): ...@@ -266,6 +266,7 @@ class ActivityAdapter(AdapterBase):
MESSAGES.APPROVE_PROJECT, MESSAGES.APPROVE_PROJECT,
MESSAGES.REQUEST_PROJECT_CHANGE, MESSAGES.REQUEST_PROJECT_CHANGE,
MESSAGES.SEND_FOR_APPROVAL, MESSAGES.SEND_FOR_APPROVAL,
MESSAGES.NEW_REVIEW,
]: ]:
return {'visibility': TEAM} return {'visibility': TEAM}
......
...@@ -41,6 +41,15 @@ VISIBILITY = { ...@@ -41,6 +41,15 @@ VISIBILITY = {
class BaseActivityQuerySet(models.QuerySet): class BaseActivityQuerySet(models.QuerySet):
def visible_to(self, user): def visible_to(self, user):
# To hide reviews from the applicant's activity feed
# Todo: It is just for historic data and not be needed for new data after this.
from .messaging import ActivityAdapter
messages = ActivityAdapter.messages
if user.is_applicant:
return self.exclude(
message=messages.get(MESSAGES.NEW_REVIEW)
).filter(visibility__in=self.model.visibility_for(user))
return self.filter(visibility__in=self.model.visibility_for(user)) return self.filter(visibility__in=self.model.visibility_for(user))
def newer(self, activity): def newer(self, activity):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment