LVLogo

Small script to find duplicate contact_mechanisms for parties in tryton

2021-01-06 — Thomas Raschbacher (LordVan)

Just a little script to find duplicate contact_mechanism entries on parties in tryton (how i run tryton stuff using ipython and proteus):

 for p in Party.find():
     cms = p.contact_mechanisms
     if cms:
         nos = []
         for cm in cms:
             if f'{cm.type} {cm.value_compact}' in nos:
                 print(f'duplicate contact mechanism {p.code=} {p.name=} {cm.value} {cm.type}')
             else:
                 nos.append(f'{cm.type} {cm.value_compact}')

I just ran this from ipython to find out if there are a lot of duplicates - turns out i had barely anything (and i fixed that before re-running the imports for good in the old system).

SIP & STUN .. SMTP timeouts (postfix, clamav-milter, cyrus-sasl)