コード例 #1
0
def interest_post():
	if session.get('logged_in') is None:
		return redirect(url_for('PetCare.login'))
	accountDao = AccountDao()
	postDao = PostDao()
	postOwnerId = postDao.add_interest(request.form['postId'], session['logged_in'].rstrip())
	if postOwnerId:
		postOwnerEmail = accountDao.get_account_email(postOwnerId)
		userEmail = accountDao.get_account_email(session['logged_in'].rstrip())
		EmailHandler.send_interest(postOwnerId, postOwnerEmail, session['logged_in'].rstrip(), userEmail)
	return redirect(url_for('PetCare.list_posts'))
コード例 #2
0
def match():
	if session.get('logged_in') is None:
		return redirect(url_for('PetCare.login'))
	accountDao = AccountDao()
	postId = accountDao.get_account_post(session['logged_in'].rstrip())
	if postId is not None:
		postDao = PostDao()
		if postDao.add_match(postId, request.form['userId']):
			careGiverEmail = accountDao.get_account_email(request.form['userId'])
			userEmail = accountDao.get_account_email(session['logged_in'].rstrip())
			EmailHandler.send_approval(careGiverEmail, postId, userEmail)
	return redirect(url_for('PetCare.profile', userId=request.form['userId']))