def _DisplayMain(self):
    error_msg = self.request.get('error')

    mod_type = self.request.get('mod_type') or 'owner'
    model = models.MANIFEST_MOD_MODELS.get(mod_type)
    if mod_type and not model:
      error_msg = 'Unknown mod_type provided; defaulting to owner'
      mod_type = 'owner'
      model = models.MANIFEST_MOD_MODELS.get(mod_type)

    mods_query = model.all().order('-mtime')

    filter_value = self.request.get('filter_value')
    filter_field = self.request.get('filter_field')
    if filter_value:
      if filter_field == 'target':
        mods_query.filter(model.TARGET_PROPERTY_NAME, filter_value)
      elif filter_field == 'package':
        mods_query.filter('value', filter_value)
      elif filter_field == 'admin':
        if '@' not in filter_value:
          filter_value += '@' + settings.AUTH_DOMAIN
        mods_query.filter('user', users.User(email=filter_value))

    mods = self.Paginate(mods_query, DEFAULT_MANIFEST_MOD_FETCH_LIMIT)

    is_admin = self.IsAdminUser()
    is_support = False
    is_security = False
    if not is_admin:
      is_support = auth.IsSupportUser()
      if not is_support:
        is_security = auth.IsSecurityUser()
    if is_admin:
      munki_pkg_names = models.PackageInfo.GetManifestModPkgNames(
          common.MANIFEST_MOD_ADMIN_GROUP)
      mod_types = MOD_TYPES
    elif is_support:
      munki_pkg_names = models.PackageInfo.GetManifestModPkgNames(
          common.MANIFEST_MOD_SUPPORT_GROUP)
      mod_types = MOD_GROUP_TYPES[common.MANIFEST_MOD_SUPPORT_GROUP]
    elif is_security:
      munki_pkg_names = models.PackageInfo.GetManifestModPkgNames(
          common.MANIFEST_MOD_SECURITY_GROUP)
      mod_types = MOD_GROUP_TYPES[common.MANIFEST_MOD_SECURITY_GROUP]
    else:
      munki_pkg_names = None
      mod_types = []

    data = {
        'mod_types': mod_types,
        'mod_type': mod_type,
        'mods': mods,
        'error': error_msg,
        'can_add_manifest_mods': is_admin or is_support or is_security,
        'munki_pkg_names': munki_pkg_names,
        'install_types': common.INSTALL_TYPES,
        'manifests': common.TRACKS,
        'report_type': 'manifests_admin',
        'mods_filter': filter_field,
        'mods_filter_value': filter_value,
    }
    self.Render('manifest_modifications.html', data)
Displays the main Manifest Modification report.
dataset/ETHPy150Open google/simian/src/simian/mac/admin/manifest_modifications.py/ManifestModifications._DisplayMain