Skip to content

Commit

Permalink
[FIX] restrict_mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
tarteo authored Sep 23, 2024
1 parent 09e94f1 commit 9e5d5cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions container_accessibility/models/restrict_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def _check_restrict(self):
):
return
restrict_domain = self._get_restrict_domain()
if restrict_domain is None or len(self.filtered_domain(restrict_domain)) < len(self):
if restrict_domain is None or len(self.filtered_domain(restrict_domain)) < len(
self
):
raise AccessError(_("Access denied to this model (%s)", self._name))

def write(self, vals):
Expand All @@ -36,7 +38,7 @@ def write(self, vals):
def create(self, vals_list):
res = super().create(vals_list)
res._check_restrict()
return res
return res

def unlink(self):
self._check_restrict()
Expand Down

0 comments on commit 9e5d5cb

Please sign in to comment.