Ejemplo n.º 1
0
	def save_user(self):

		if not re.match(r'\d{4}-\d{2}-\d{2}', self.dob.text):
			Popup(
				title='Input Error.',
				content=Label(
					text='Date is in the incorrect format.'
				),
				size_hint=(.8, .2)
			).open()
		else:
			j = {
				"Email": self.uni_email.text, "First_Name": self.first_name.text,
				"Last_Name": self.last_name.text, "DateOfBirth": self.dob.text, 
				"Password": self.password.text
			}

			created_user = User_Requests.create(j)
			if 'error' not in created_user:
				UserStore.put(
					'user_info',  
					token=created_user["access_token"], 
					id=created_user["data"]["User_ID"]
				)
				App.get_running_app().root.current = "account_verification"
			else:
				Popup(
					title=created_user['error']['title'],
					content=Label(
						text=created_user['error']['description']
					),
					size_hint=(.8, .2)
				).open()
Ejemplo n.º 2
0
 def __init__(self):
     self._user_info = self.get_user_info()
     self._resp = User_Requests.create(self._user_info)