def _check_deid_permissions(permissions, export_instances): if not permissions.has_deid_view_permissions: for instance in export_instances: if instance.is_deidentified: raise ExportAsyncException( _("You do not have permission to export de-identified exports." ))
def _check_export_size(domain, export_instances, export_filters): count = 0 for instance in export_instances: count += get_export_size(instance, export_filters) if count > MAX_EXPORTABLE_ROWS and not PAGINATED_EXPORTS.enabled(domain): raise ExportAsyncException( _("This export contains %(row_count)s rows. Please change the " "filters to be less than %(max_rows)s rows.") % { 'row_count': count, 'max_rows': MAX_EXPORTABLE_ROWS })