def _anonymise_admin(record): new_email = anon_email(record.get_latest_contact_email()) record.remove_contacts() record.add_contact(anon_name(), new_email) for note in record.notes[:]: record.remove_note(note) record.add_note(basic_hash(note['note'])) return record
def anonymise_suggestion(record): try: sug = models.Suggestion(**record) except DataStructureException: return record sug = _anonymise_admin(sug) sug.set_suggester(anon_name(), anon_email(sug.suggester['email'])) return sug.data
def test_03_anon_email(self): assert anon_email('*****@*****.**') == '*****@*****.**'
def _anonymise_email(record): record.set_email(anon_email(record.email)) return record
def test_03_anon_email(self): assert anon_email( '*****@*****.**' ) == '*****@*****.**'