code: def manager_required(func=None):
      
      def decorator(view_func):
          @team_required
          @login_required
          @functools.wraps(view_func, assigned=available_attrs(view_func))
          def _wrapped_view(request, *args, **kwargs):
              role = request.team.role_for(request.user)
              if role not in [Membership.ROLE_MANAGER, Membership.ROLE_OWNER]:
                  raise Http404()
              return view_func(request, *args, **kwargs)
          return _wrapped_view
      if func:
          return decorator(func)
      return decorator
docs: Decorator for views that require not only a team but also that a user be
      logged in and be the manager or owner of that team.