diff --git a/apps/member/views.py b/apps/member/views.py index ed52e2a3..9a585ede 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -254,8 +254,8 @@ class ProfileAliasView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) note = context['object'].note - context["aliases"] = AliasTable(note.alias_set.filter(PermissionBackend - .filter_queryset(self.request.user, Alias, "view")).all()) + context["aliases"] = AliasTable( + note.alias_set.filter(PermissionBackend.filter_queryset(self.request.user, Alias, "view")).distinct().all()) context["can_create"] = PermissionBackend.check_perm(self.request.user, "note.add_alias", Alias( note=context["object"].note, name="", @@ -457,8 +457,8 @@ class ClubAliasView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) note = context['object'].note - context["aliases"] = AliasTable(note.alias_set.filter(PermissionBackend - .filter_queryset(self.request.user, Alias, "view")).all()) + context["aliases"] = AliasTable(note.alias_set.filter( + PermissionBackend.filter_queryset(self.request.user, Alias, "view")).distinct().all()) context["can_create"] = PermissionBackend.check_perm(self.request.user, "note.add_alias", Alias( note=context["object"].note, name="",