Landing page shared count fix

* fixes bug where count of shared entries on landing page would ignore team-shared entries
* restore prior editable column icon rendering
This commit is contained in:
mpeltriaux 2022-10-19 07:24:00 +02:00
parent 48aee04955
commit 048af01795
2 changed files with 8 additions and 7 deletions

View File

@ -216,7 +216,7 @@ class TableRenderMixin:
html += self.render_icn(
tooltip=_("Full access granted") if has_access else _("Access not granted"),
icn_class="fas fa-share-alt rlp-r-inv" if has_access else "",
icn_class="fas fa-edit rlp-r-inv" if has_access else "far fa-edit",
)
return format_html(html)

View File

@ -6,6 +6,7 @@ Created on: 19.08.22
"""
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.http import HttpRequest
from django.shortcuts import render
from django.utils import timezone
@ -50,22 +51,22 @@ def home_view(request: HttpRequest):
)
# Then fetch only user related ones
user_interventions = interventions.filter(
users__in=[user]
)
Q(users__in=[user]) | Q(teams__in=user.shared_teams)
).distinct()
# Repeat for other objects
comps = Compensation.objects.filter(
deleted=None,
)
user_comps = comps.filter(
intervention__users__in=[user]
)
Q(intervention__users__in=[user]) | Q(intervention__teams__in=user.shared_teams)
).distinct()
eco_accs = EcoAccount.objects.filter(
deleted=None,
)
user_ecco_accs = eco_accs.filter(
users__in=[user]
)
Q(users__in=[user]) | Q(teams__in=user.shared_teams)
).distinct()
additional_context = {
"msgs": msgs,