版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
报错:TypeError: init() got an unexpected keyword argument ‘method’
下面的method少了一个s所以会报错!
@web.route(’/drift/int:gid’,method=[‘GET’,‘POST’])
@login_required
def send_drift(gid):
current_gift = Gift.query.get_or_404(gid) #根据礼物id号把此次交易的礼物给查询出来
if current_gift.is_yourself_gift(current_user.id):
flash('这本书是你自己的,不能向自己索要书籍')
return redirect(url_for('web.book_detail', isbn=current_gift.isbn))
can = current_user.can_send_drift() #当前用户是否可以发送鱼漂逻辑
if not can:
return render_template('not_enough_beans.html', beans=current_user.beans)
gifter = current_gift.user.summary
return render_template('drift.html',gifter=gifter,user_beans=current_user.beans)