def create_user(acquire_form): username = get_data(acquire_form, 'username') first_name = get_data(acquire_form, 'first_name') last_name = get_data(acquire_form, 'last_name') email = get_data(acquire_form, 'email') user = User(username=username, first_name=first_name, last_name=last_name, email=email) user.save() return user
def create_profile(acquire_form, charger, user): title = get_data(acquire_form, 'title') phone = get_data(acquire_form, 'phone') company = get_data(acquire_form, 'company') address = get_data(acquire_form, 'address') postal_code = get_data(acquire_form, 'postal_code') city = get_data(acquire_form, 'city') country = get_data(acquire_form, 'country') profile = UserProfile(user=user, phone=phone, company=company, order_id=charger.get_order(), title=title, address=address, city=city, country=country, postal_code=postal_code) profile.save() return profile