Skip to content

Commit

Permalink
feat: don't show voted comments in gdpr get
Browse files Browse the repository at this point in the history
We don't want to display the comments which user has voted.

Refs KER-280
  • Loading branch information
nicobav committed Feb 23, 2024
1 parent 7474d7a commit ecb3705
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
5 changes: 0 additions & 5 deletions kerrokantasi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class User(AbstractUser, SerializableMixin):
{"name": "email"},
{"name": "has_strong_auth"},
{"name": "sectioncomments"},
{"name": "voted_sectioncomments"},
{"name": "followed_hearings"},
{"name": "admin_organizations"},
{"name": "hearing_created"},
Expand All @@ -30,10 +29,6 @@ class User(AbstractUser, SerializableMixin):
def sectioncomments(self):
return [s.serialize() for s in SectionComment.objects.everything(created_by=self).iterator()]

@property
def voted_sectioncomments(self):
return [s.serialize() for s in self.voted_democracy_sectioncomment.everything().iterator()]

def __str__(self):
return " - ".join([super().__str__(), self.get_display_name(), self.email])

Expand Down
6 changes: 0 additions & 6 deletions kerrokantasi/tests/gdpr/test_gdpr_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,6 @@ def _get_user_data(user: User) -> List[dict]:
for comment in SectionComment.objects.everything(created_by=user).iterator()
],
},
{
"key": "VOTED_SECTIONCOMMENTS",
"value": [
_get_section_comment_data(comment) for comment in user.voted_democracy_sectioncomment.everything()
],
},
{
"key": "FOLLOWED_HEARINGS",
"children": [_get_hearing_data(hearing) for hearing in user.followed_hearings.all()],
Expand Down

0 comments on commit ecb3705

Please sign in to comment.