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:
parent
a203d73471
commit
1a8034fa20
@ -216,7 +216,7 @@ class TableRenderMixin:
|
|||||||
|
|
||||||
html += self.render_icn(
|
html += self.render_icn(
|
||||||
tooltip=_("Full access granted") if has_access else _("Access not granted"),
|
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)
|
return format_html(html)
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ Created on: 19.08.22
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
|
from django.db.models import Q
|
||||||
from django.http import HttpRequest
|
from django.http import HttpRequest
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
@ -50,22 +51,22 @@ def home_view(request: HttpRequest):
|
|||||||
)
|
)
|
||||||
# Then fetch only user related ones
|
# Then fetch only user related ones
|
||||||
user_interventions = interventions.filter(
|
user_interventions = interventions.filter(
|
||||||
users__in=[user]
|
Q(users__in=[user]) | Q(teams__in=user.shared_teams)
|
||||||
)
|
).distinct()
|
||||||
|
|
||||||
# Repeat for other objects
|
# Repeat for other objects
|
||||||
comps = Compensation.objects.filter(
|
comps = Compensation.objects.filter(
|
||||||
deleted=None,
|
deleted=None,
|
||||||
)
|
)
|
||||||
user_comps = comps.filter(
|
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(
|
eco_accs = EcoAccount.objects.filter(
|
||||||
deleted=None,
|
deleted=None,
|
||||||
)
|
)
|
||||||
user_ecco_accs = eco_accs.filter(
|
user_ecco_accs = eco_accs.filter(
|
||||||
users__in=[user]
|
Q(users__in=[user]) | Q(teams__in=user.shared_teams)
|
||||||
)
|
).distinct()
|
||||||
|
|
||||||
additional_context = {
|
additional_context = {
|
||||||
"msgs": msgs,
|
"msgs": msgs,
|
||||||
|
Loading…
Reference in New Issue
Block a user