'Error when Same Company is entered multiple times in accounts'

def validate_repeating_companies(self):

    accounts_list = []
    for entry in self.accounts:
        accounts_list.append(entry.company)
    if (len(accounts_list) != len(set(accounts_list))):
        frappe.throw(_(u'Same    Company    is    entered    more    than    once'))
