|
|
@@ -49,20 +49,16 @@ def profile():
|
|
|
|
|
|
return render_template("profile.html", user=current_user)
|
|
|
|
|
|
-#recipient_id = None
|
|
|
-
|
|
|
@logic.route('/matchbook', methods=['GET', 'POST'])
|
|
|
@login_required
|
|
|
def matchbook():
|
|
|
all_users = User.query.all()
|
|
|
|
|
|
if request.method == 'POST':
|
|
|
- #global recipient_id
|
|
|
recipient_id = request.form.get('message_recipient')
|
|
|
- fdbcall = User.query.filter_by(id=current_user.id).first()##
|
|
|
- fdbcall.focus = recipient_id##
|
|
|
- db.session.commit()##
|
|
|
-
|
|
|
+ fdbcall = User.query.filter_by(id=current_user.id).first()
|
|
|
+ fdbcall.focus = recipient_id
|
|
|
+ db.session.commit()
|
|
|
return redirect(url_for('logic.messaging'))
|
|
|
|
|
|
return render_template("matchbook.html", user=current_user, userlist=all_users)
|
|
|
@@ -70,7 +66,7 @@ def matchbook():
|
|
|
@logic.route('/messaging', methods=['GET', 'POST'])
|
|
|
@login_required
|
|
|
def messaging():
|
|
|
- recipient_id = current_user.focus##
|
|
|
+ recipient_id = current_user.focus
|
|
|
recipient = User.query.filter_by(id=recipient_id).first()
|
|
|
|
|
|
sent_history = Message.query.filter_by(sender=current_user.id, recipient=recipient.id).all()
|