Skip to content

Commit

Permalink
Add has_view_auditallsites to view mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanWillitts committed Jan 24, 2024
1 parent 374798f commit 363336a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions edc_sites/view_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from django.core.exceptions import ObjectDoesNotExist

from .auths import view_auditallsites_codename
from .models import SiteProfile
from .site import SiteNotRegistered, sites

Expand All @@ -21,4 +22,6 @@ def get_context_data(self, **kwargs) -> dict:
"Unable to determine site profile 'title'. No sites have been registered! "
)
raise
codename = f"edc_sites.{view_auditallsites_codename}"
kwargs.update(has_view_auditallsites=self.request.user.has_perm(codename))
return super().get_context_data(**kwargs)

0 comments on commit 363336a

Please sign in to comment.