'check that there are only 3 enabled reports per user'

def validate_report_count(self):

    count = frappe.db.sql(u'select    count(*)    from    `tabAuto    Email    Report`    where    user=%s    and    enabled=1', self.user)[0][0]
    if (count > (max_reports_per_user + ((-1) if self.flags.in_insert else 0))):
        frappe.throw(_(u'Only    {0}    emailed    reports    are    allowed    per    user').format(max_reports_per_user))
