def verify(self, username, *codes): participant = P(username) for code in codes: country_id = Country.from_code(code).id participant.store_identity_info(country_id, 'nothing-enforced', {}) participant.set_identity_verification(country_id, True) return participant
def test_ip_stores_identity(self): bob = P('bob') assert len(bob.list_identity_metadata()) == 1 data = { 'id_type': '' , 'id_number': '' , 'legal_name': 'Bobsworth B. Bobbleton, IV' , 'dob': '' , 'address_1': '' , 'address_2': '' , 'city': '' , 'region': '' , 'postcode': '' , 'action': 'store' } assert self.client.PxST('/~bob/identities/US', auth_as='bob', data=data).code == 302 assert len(bob.list_identity_metadata()) == 2 info = bob.retrieve_identity_info(Country.from_code('US').id) assert info['legal_name'] == 'Bobsworth B. Bobbleton, IV'
def test_ip_stores_identity(self): bob = P('bob') assert len(bob.list_identity_metadata()) == 1 data = { 'id_type': '', 'id_number': '', 'legal_name': 'Bobsworth B. Bobbleton, IV', 'dob': '', 'address_1': '', 'address_2': '', 'city': '', 'region': '', 'postcode': '', 'action': 'store' } assert self.client.PxST('/~bob/identities/US', auth_as='bob', data=data).code == 302 assert len(bob.list_identity_metadata()) == 2 info = bob.retrieve_identity_info(Country.from_code('US').id) assert info['legal_name'] == 'Bobsworth B. Bobbleton, IV'
def identify(self, username, *codes): participant = P(username) for code in codes: country_id = Country.from_code(code).id participant.store_identity_info(country_id, 'nothing-enforced', {}) return participant
def identify(self, username, *codes): participant = Participant.from_username(username) for code in codes: country_id = Country.from_code(code).id participant.store_identity_info(country_id, 'nothing-enforced', {}) return participant
#!/usr/bin/env python """verify-identity.py <participant_id>, <country_code> """ from __future__ import absolute_import, division, print_function, unicode_literals import sys from gratipay import wireup from gratipay.models.participant import Participant from gratipay.models.country import Country wireup.db(wireup.env()) participant = Participant.from_id(int(sys.argv[1])) country = Country.from_code(sys.argv[2]) participant.set_identity_verification(country.id, True)
#!/usr/bin/env python """verify-identity.py <participant_id> <country_code> """ from __future__ import absolute_import, division, print_function, unicode_literals import sys from gratipay import wireup from gratipay.models.participant import Participant from gratipay.models.country import Country wireup.db(wireup.env()) participant = Participant.from_id(int(sys.argv[1])) country = Country.from_code(sys.argv[2]) participant.set_identity_verification(country.id, True)