def add_user(): user = current_user fmail = request.args.get('umail') plus = request.args.get('plus') if user.mail == fmail: flash('您不能添加自己!') elif Friend.is_friends(user.usrid, fmail): flash('您与 ' + fmail + ' 已是好友,不能重复添加!') else: Friend.add_friends(user.usrid, fmail) flash('添加好友成功!') return redirect('/search_result')