def create_respondent(email): email_in_use = get_party_by_email(email) if not email_in_use: register_respondent(survey_id='cb8accda-6118-4d3b-85a3-149e28960c54', period='201801', username=email, ru_ref=49900000001)
def creating_unverified_account(username): email_in_use = get_party_by_email(username) if not email_in_use: register_respondent(survey_id='cb8accda-6118-4d3b-85a3-149e28960c54', period='201801', username=username, ru_ref=49900000001, verified=False)
def _add_survey_for_ru_to_respondent_suppress_exception( respondent_email, ru_ref, collection_exercise_id): business_id = get_party_by_ru_ref(ru_ref)['id'] b_case = get_b_case(collection_exercise_id, business_id) enrolment_code = generate_new_enrolment_code(b_case['id'], business_id) # Suppress exception in case the survey has already been added with suppress(Exception): add_survey(get_party_by_email(respondent_email)['id'], enrolment_code)
def create_respondent_account(context): respondent_party = get_party_by_email(context.respondent_email) assert respondent_party is not None, f'No respondent with email {context.respondent_email} exists'
def check_no_respondent(_, email_address): respondent_party = get_party_by_email(email_address) assert respondent_party is None, "Respondent with email " + email_address + " should not exist."
def get_party_from_email(email): return party_controller.get_party_by_email(email)