def create_user_and_details(username, password, email, first_name, last_name, mug, favCompany, favBaristaObj): user = User(username=username, password=password, email=email) user.set_password(password) user.save() userdetails = user.get_profile() userdetails.mug = mug userdetails.first_name = first_name userdetails.last_name = last_name userdetails.favCompany = favCompany userdetails.favBaristaObj = favBaristaObj userdetails.save()
def create_barista_and_details(username, password, email, usercheckedin, first_name, last_name, mug): barista = User(username=username, password=password, email=email) barista.set_password(password) barista.save() baristadetails = barista.get_profile() baristadetails.userType = 'Barista' baristadetails.usercheckedin = usercheckedin baristadetails.first_name = first_name baristadetails.last_name = last_name baristadetails.mug = mug baristadetails.save()