def page_context(self): if (not self.can_restrict_access_by_location and any(not role.permissions.access_all_locations for role in self.user_roles) ): messages.warning(self.request, _( "This project has user roles that restrict data access by " "organization, but the software plan no longer supports that. " "Any users assigned to roles that are restricted in data access " "by organization can no longer access this project. Please " "update the existing roles.")) return { 'user_roles': self.user_roles, 'can_edit_roles': self.can_edit_roles, 'default_role': UserRole.get_default(), 'report_list': get_possible_reports(self.domain), 'web_apps_list': get_cloudcare_apps(self.domain), 'apps_list': get_brief_apps_in_domain(self.domain), 'invitations': self.invitations, 'requests': DomainRequest.by_domain(self.domain) if self.request.couch_user.is_domain_admin else [], 'admins': WebUser.get_admins_by_domain(self.domain), 'domain_object': self.domain_object, 'uses_locations': self.domain_object.uses_locations, 'can_restrict_access_by_location': self.can_restrict_access_by_location, 'landing_page_choices': self.landing_page_choices, 'show_integration': ( toggles.OPENMRS_INTEGRATION.enabled(self.domain) or toggles.DHIS2_INTEGRATION.enabled(self.domain) ), }
def page_context(self): return { 'invitations': self.invitations, 'requests': DomainRequest.by_domain(self.domain) if self.request.couch_user.is_domain_admin else [], 'admins': WebUser.get_admins_by_domain(self.domain), 'domain_object': self.domain_object, }
def page_context(self): return { 'user_roles': self.user_roles, 'can_edit_roles': self.can_edit_roles, 'default_role': UserRole.get_default(), 'report_list': get_possible_reports(self.domain), 'invitations': self.invitations, 'requests': DomainRequest.by_domain(self.domain) if self.request.couch_user.is_domain_admin else [], 'admins': WebUser.get_admins_by_domain(self.domain), 'domain_object': self.domain_object, 'uses_locations': self.domain_object.uses_locations, }
def page_context(self): return { "user_roles": self.user_roles, "can_edit_roles": self.can_edit_roles, "default_role": UserRole.get_default(), "report_list": get_possible_reports(self.domain), "invitations": self.invitations, "requests": DomainRequest.by_domain(self.domain) if self.request.couch_user.is_domain_admin else [], "admins": WebUser.get_admins_by_domain(self.domain), "domain_object": self.domain_object, "uses_locations": self.domain_object.uses_locations, }