Exemplo n.º 1
0
	def user_register(self):
		while(True):
			## this gathers the user info
			username = Views.user_register()
			password = Views.password_prompt()
			permission_level = Views.permission_prompt()
			## i create an object of choices here
			choices = {'banker': DB_API.create_user, 'client': DB_API.create_user, None : self.sign_in}
			# id the persons choice is not in the object above keys then we throw an error. If it is fire of the function inside
			if permission_level is None:
				choices[permission_level]
			else:
				choices[permission_level](username, password, permission_level)
				self.user = DB_API.fetch_user(username)
				self.main_menu()