コード例 #1
0
def subscribe(topic_id):
    """Adds user to subscription table."""
    userId = user_interface.getUserId()[0]
    subscriptionInterface.addSubscription(str(userId), str(topic_id))

    flash("You are now subscribed")
    return redirect(url_for('show_topicPosts', topic_id=topic_id))
コード例 #2
0
def down_vote(topic_id, post_id, username):

    userId = user_interface.getUserId()[0]
    print("downvote")
    VotesInterface.callDownVote(str(userId), str(post_id))
    ##return render_template(url_for('show_post', topic_id=topic_id, post_id=post_id))
    return redirect(url_for('show_post', post_id=post_id, topic_id=topic_id))
コード例 #3
0
def notifications():
    """Gets all notifications for a user to be rendered."""
    userId = user_interface.getUserId()[0]
    notifications = notificationInterface.getNotifications(str(userId))

    return render_template('notifications.html', notifications=notifications)