def add_artist(): new_artist = ui.get_artist_info() all_artists = store.get_all_artists() if new_artist in all_artists: ui.message('The artist already exists') else: store.add_artist(new_artist) new_artist = ui.get_artist_info() new_artist.save()
def add_new_artist(): try: #gets name and email new_artist = ui.get_artist_info() #checks if name already exits artist = art_work.check_if_artist_exists(new_artist.name) #if artist doesn't exist add and confirm if artist is False: art_work.add_artist(new_artist) ui.confirmation('successfully added ' + new_artist.name) # if it exists error message else: ui.failed(new_artist.name + ' has not been added') except Exception as e: print(e)
def add_artist(): new_artist = ui.get_artist_info() try: new_artist.save() except peewee.IntegrityError: ui.message('Error, artist already exists in the database')
def add_artist(): new_artist = ui.get_artist_info() try: new_artist.insert_artist() except: print('This artist is already in the database.')
def artist_email(): artist_email = ui.get_artist_info() try: artist_email.save() except peewee.IntegrityError: ui.message('Error, email already exists in the database')
def artist_name(): artist_name = ui.get_artist_info() try: artist_name.save() except peewee.IntegrityError: ui.message('Error, artist already exists in the database')