146_Minor_improvements #150

Merged
mpeltriaux merged 6 commits from 146_Minor_improvements into master 2022-04-14 14:13:15 +02:00
3 changed files with 4 additions and 10 deletions
Showing only changes of commit 23b6130907 - Show all commits

View File

@ -181,9 +181,7 @@ class CompensationTable(BaseTable, TableRenderMixin):
"""
if value is None:
value = User.objects.none()
has_access = value.filter(
id=self.user.id
).exists()
has_access = record.is_shared_with(self.user)
html = self.render_icn(
tooltip=_("Full access granted") if has_access else _("Access not granted"),
@ -343,7 +341,7 @@ class EcoAccountTable(BaseTable, TableRenderMixin):
html = ""
# Do not use value in here, since value does use unprefetched 'users' manager, where record has already
# prefetched users data
has_access = self.user in record.users.all()
has_access = record.is_shared_with(self.user)
html += self.render_icn(
tooltip=_("Full access granted") if has_access else _("Access not granted"),
icn_class="fas fa-edit rlp-r-inv" if has_access else "far fa-edit",

View File

@ -151,9 +151,7 @@ class EmaTable(BaseTable, TableRenderMixin):
"""
html = ""
has_access = value.filter(
id=self.user.id
).exists()
has_access = record.is_shared_with(self.user)
html += self.render_icn(
tooltip=_("Full access granted") if has_access else _("Access not granted"),

View File

@ -177,9 +177,7 @@ class InterventionTable(BaseTable, TableRenderMixin):
"""
html = ""
has_access = value.filter(
id=self.user.id
).exists()
has_access = record.is_shared_with(self.user)
html += self.render_icn(
tooltip=_("Full access granted") if has_access else _("Access not granted"),