def required_decorator(self):
        def decorator(view_func):
            @wraps(view_func)
            def wrapped_view(request, *args, **kwargs):
                if (
                    (hasattr(request, 'user') and self.enabled(request.user.username))
                    or (hasattr(request, 'domain') and self.enabled(request.domain))
                ):
                    return view_func(request, *args, **kwargs)
                raise Http404()
            return wrapped_view
        return decorator
Returns a view function decorator that checks to see if the domain
dataset/ETHPy150Open dimagi/commcare-hq/corehq/toggles.py/StaticToggle.required_decorator