I am making a project for school. This sign up system is working as expected, but the problem is that once an email/password is entered < 3 characters once, even entering a correct length of value causes it to throw the error.
I think it is because the method is not getting the information from my entry forms twice, and is recognizing the first get of data. I have tried to place this is a while loop with well set conditions, it still acts funky.
All I am asking for is that someone introduce me to a simple way for this message box to be thrown once, so they can enter in new information (just as my email already exists statement works).
Code:
def go(self):
run = True
email = self.email_entry.get()
password = self.password_entry.get()
if len(email) or len(password) < 3:
tkinter.messagebox.showinfo("Error", "Please enter a valid email/password -- (minimum three characters")
run = False
if run:
if email not in self.customers:
self.customers[email] = password
with open("shopping_list.dat", "wb") as data_file:
pickle.dump(self.customers, data_file)
self.sign_up.destroy()
shopping_list = ShoppingList()
else:
tkinter.messagebox.showinfo("Error", "The email entered already exists...try again.")