Пример #1
0
def privacy_setting():
    form = PrivacySettingForm()
    if form.validate_on_submit():
        current_user.public_collections = form.public_collections.data
        db.session.commit()
        flash('Privacy settings updated.', 'success')
        return redirect(url_for('.index', username=current_user.username))
    form.public_collections.data = current_user.public_collections
    return render_template('user/settings/edit_privacy.html', form=form)
Пример #2
0
def privacy_setting():
	"""
	隐私设置
	"""
	logger.info('url = ' + str(request.url))
	form = PrivacySettingForm()
	if form.validate_on_submit():
		current_user.public_collections = form.public_collections.data
		db.session.commit()
		flash('设置更新成功!', 'success')
		return redirect(url_for('.index', username=current_user.username))
	form.public_collections.data = current_user.public_collections
	return render_template('user/settings/edit_privacy.html', form=form)