def post(self):
		nickname = self.request.get('nickname')
		email = self.request.get('email')
		password = self.request.get('password')
		password2 = self.request.get('password2')
		if password2 != password:
			self.session.start(None)
			self.session[ 'flash_msg' ] = '<p>Password fields did not match.</p>'
			self.redirect('/signup')
			return
		user = User.get_or_insert(nickname=nickname,
					email=email,
					pwd=salt_n_hash(password),
					key_name=nickname)
		self.session.start(None)
		if not User.authenticate(nickname, password):
			self.session[ 'flash_msg' ] = '<p>Sorry, the nickname you chose is already taken.</p>'
			self.redirect(self.request.url)
			return
		id = signup_id(nickname)
		signup = UserSignup(user=user, key_name=id)
		signup.put()
		confirm_url = self.request.relative_url('confirmsignup?id='+id)
		from google.appengine.api import mail
		sender = 'Registrar <registrar@app-id.appspotmail.com>'
		subject = 'Confirm your registration'
		body = \
			'Hello %s,\n\n' % nickname + \
			'To confirm your registration, please visit the link below:\n\n' + \
			'<%s>\n' % confirm_url
		mail.send_mail( sender, email, subject, body )
		self.session['flash_msg'] = \
			'<p>Thank you for signing up, %s! A confirmation ' % nickname + \
			'message is on its way to your email inbox. It will contain a link ' + \
			'which you will need to visit in order to complete your registration.</p>' + \
			'<p>See you soon!</p>'
		self.redirect('/')
dataset/ETHPy150Open aht/suas/suas/auth_handlers.py/Signup.post/original