示例#1
0
def notification_setting():
    form = NotificationSettingForm()
    if form.validate_on_submit():
        current_user.receive_collect_notification = form.receive_collect_notification.data
        current_user.receive_comment_notification = form.receive_comment_notification.data
        current_user.receive_follow_notification = form.receive_follow_notification.data
        db.session.commit()
        flash("Notification settings updated.", "success")
        return redirect(url_for("user.index", username=current_user.username))
    form.receive_collect_notification.data = current_user.receive_collect_notification
    form.receive_comment_notification.data = current_user.receive_comment_notification
    form.receive_follow_notification.data = current_user.receive_follow_notification
    return render_template("user/settings/edit_profile.html", form=form)
示例#2
0
def notification_setting():
    form = NotificationSettingForm()
    if form.validate_on_submit():
        current_user.receive_collect_notification = form.receive_collect_notification.data
        current_user.receive_comment_notification = form.receive_comment_notification.data
        current_user.receive_follow_notification = form.receive_follow_notification.data
        db.session.commit()
        flash('Notification settings updated.', 'success')
        return redirect(url_for('.index', username=current_user.username))
    form.receive_collect_notification.data = current_user.receive_collect_notification
    form.receive_comment_notification.data = current_user.receive_comment_notification
    form.receive_follow_notification.data = current_user.receive_follow_notification
    return render_template('user/settings/edit_notification.html', form=form)
示例#3
0
def notification_setting():
	"""
	消息提醒设置
	"""
	logger.info('url = ' + str(request.url))
	form = NotificationSettingForm()
	if form.validate_on_submit():
		current_user.receive_collect_notification = form.receive_collect_notification.data
		current_user.receive_comment_notification = form.receive_comment_notification.data
		current_user.receive_follow_notification = form.receive_follow_notification.data
		db.session.commit()
		flash('消息提醒更新成功!', 'success')
		return redirect(url_for('.index', username=current_user.username))
	form.receive_collect_notification.data = current_user.receive_collect_notification
	form.receive_comment_notification.data = current_user.receive_comment_notification
	form.receive_follow_notification.data = current_user.receive_follow_notification
	return render_template('user/settings/edit_notification.html', form=form)