def unfollow(): userid = request.args.get('userid') if userid: user = User.query.get(userid) if user: current_user.unfollow(user) return redirect(url_for('member.member_page', userid=userid))
def unfollow_user(user_id): user = User.get_by_id(user_id) current_user.unfollow(user) flash(_("You are now not following") + " %s" % user.name, "success") return render_template( "user/profile.html", user=user, current_user=current_user, followed=current_user.is_following(user) )
def follow(): if request.method == 'GET': return render_template("find.html") elif request.method == 'POST': search = request.form['txtSearch'] usr = User.query.filter_by(username=search) results = usr.all() if len(results) == 1: usr = usr.one() f = [str(u.username) for u in usr.followers.all()] if search in f: flash('Already following %s' % search) return redirect(url_for('index')) elif search == str(current_user.username): flash('Users cannot follow themselves') return redirect(url_for('index')) else: current_user.unfollow(usr) new_follower = current_user.follow(usr) db.session.add(new_follower) db.session.commit() flash('You are now following %s' % search) return redirect(url_for('index')) else: flash('No user found with username "%s"' % search) return render_template("find.html") else: abort(405)
def unfollow(username): user = User.query.filter_by(userName=username).first() if user is None: flash(u'没有该用户') current_user.unfollow(user) flash(u'成功取消对%s的关注' % username) return redirect(url_for('main.user_zone', username=username))
def unfollow_user(user_id): user = User.get_by_id(user_id) current_user.unfollow(user) flash(_("You are now not following") + " %s" % user.name, 'success') return render_template('user/profile.html', user=user, current_user=current_user, followed=current_user.is_following(user))
def unfollow(id): user = User.query.get_or_404(id) if (not current_user.is_following(user)): flash("You are already unfollowing this user.") return redirect(url_for("main.profile", id=user.id)) current_user.unfollow(user) flash("You are no long following %s now." % user.nickname) return redirect(url_for("main.profile", id=user.id))
def unfillow(username): user = User.query.filter_by(username=username).first() if user is None: return jsonify({'error': 'Invalid user'}) if not current_user.is_following(user): return jsonify({'error': 'You are not following that user'}) current_user.unfollow(user) return jsonify({'message': 'Success'})
def unfollow(username): user = User.query.filter_by(username = username).first() if user is None: flash('Invalid request!') return redirect(url_for('main.index')) current_user.unfollow(user) flash('Cancel follow... success!') return redirect(url_for('main.user', username = user.username))
def unfollow(id): user = User.query.get_or_404(id) if (not current_user.is_following(user)): flash("You are already unfollowing this user.") return redirect(url_for("main.profile", id=user.id)) current_user.unfollow(user) flash("You are no long following %s now." % user.nickname) return redirect(url_for("main.profile", id=user.id))
def unfollow_user(id, id2): current_user = User.query.filter(User.id == id2).first() user = User.query.filter(User.id == id).first() if user is not None: current_user.unfollow(user) return jsonify({"status": 1, "msg": "unfollow success"}) return jsonify({"status": 0, "msg": "follow fail, can't find user"})
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: return redirect(url_for('main.home')) if not current_user.is_following(user): return redirect(url_for('main.viewperson', username=username)) current_user.unfollow(user) return redirect(url_for('main.viewperson', username=username))
def unfollow(username): user = User.objects(username=username).first_or_404() if not current_user.is_following(user): flash(u'你未关注该用户') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(u'已取消关注') return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('用户不存在。') return redirect(url_for('.index')) current_user.unfollow(user) flash('你不再关注 %s。' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first_or_404() if not current_user.is_following(user): flash(u'你未关注该用户') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(u'已取消关注') return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('该用户不存在') if not current_user.is_following(user): flash('您未关注此用户') current_user.unfollow(user) flash('您现在已取消关注该用户 %s.' % username) return redirect(url_for('.user', username=username))
def unfollow(user_id): user = User.query.get_or_404(user_id) current_user.unfollow(user) current_user.save() user.save() save_action('"' + current_user.username + '"' + u"关注 了 "+ '"' + user.username + '"') return jsonify(success=True, reload=True)
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'取消关注失败') return redirect(url_for('.index')) if current_user.is_following(user): current_user.unfollow(user) return redirect(url_for('.index', username=username)) return redirect(url_for('.index',username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid User') return redirect(url_for('.index')) if current_user.is_following(user) is False: flash('You are not following them') return redirect(url_for('.user', username=username)) current_user.unfollow(user) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid user.') return redirect(url_for('.index')) if not current_user.is_following(user): flash('You are not following this user') current_user.unfollow(user) flash('You are not following %s anymore' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('用户不存在.') return redirect(url_for('main.index')) if not current_user.is_following(user): flash('您已不再关注%s.' % username) return redirect(url_for('main.user', username=username)) current_user.unfollow(user) return redirect(url_for('main.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('用户不存在.') return redirect(url_for('main.index')) if not current_user.is_following(user): flash('您已不再关注%s.' % username) return redirect(url_for('main.user', username=username)) current_user.unfollow(user) return redirect(url_for('main.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid User') return redirect('.user', username=username) if not current_user.is_following(user): flash('You are not following the user!') current_user.unfollow(user) flash('You are not following the %s anymore!' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'不合法的用户。') return redirect(url_for('.index')) if not current_user.is_following(user): flash(u'您没有关注该用户。') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(u'您已经取消了对%s的关注。' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'非法用户') return redirect(url_for('.index')) if not current_user.is_following(user): flash(u'没有关注该用户') return redirect(url_for('.profile', id=user.id)) current_user.unfollow(user) flash(u'已经对该用户取消关注') return redirect(url_for('.profile', id=user.id))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('无此用户') return redirect(url_for('.index')) if not current_user.is_following(user): flash('您未关注此用户') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash('已取消关注 %s' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid user.') return redirect(url_for('.index')) if not current_user.is_following(user): flash(_('You are not following this user.')) return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(_('You are not following %s anymore.') % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash("非法用户") return redirect(url_for(".index")) if not current_user.is_following(user): flash("您还没关注Ta") return redirect(url_for(".user", username=username)) current_user.unfollow(user) flash("您咩有关注 %s anymore." % username) return redirect(url_for(".user", username=username))
def unfollow(username): user = User.query.filter_by(username = username).first() if user is None: flash(u'非法用户') return redirect(url_for('main.index')) if not current_user.is_following(user): flash(u'你没有关注这个用户。') return redirect(url_for('.user', username = username)) current_user.unfollow(user) flash(u'你取消关注了%s。' % username ) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('无效的用户名') return redirect(url_for('main.index')) if not current_user.is_following(user): flash('你还没有关注该用户') return redirect(url_for('main.profile', username=username)) current_user.unfollow(user) flash('你已经取消关注 %s ' % username) return redirect(url_for('main.profile', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('该用户不存在.'.decode('utf-8')) return redirect(url_for('.index')) if not current_user.is_following(user): flash('你没关注该用户.'.decode('utf-8')) return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash('你不在关注 %s.'.decode('utf-8') % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'用户不存在') return redirect(url_for('.index')) if not current_user.is_following(user): flash(u'您还没有关注这个用户.') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(u'取消关注 %s ' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'不存在的用户') return redirect(url_for('.index')) if not current_user.is_following(user): flash(u'您并未关注该用户') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(u'你不再关注%s' % username) return redirect(url_for('.user', username=username))
def unfollow(storename): store = Store.query.filter_by(name=storename).first() if store is None: flash('Invalid user.') return redirect(url_for('.index')) if not current_user.is_following(store): flash('You are not following this user.') return redirect(url_for('.store', id=store.id)) current_user.unfollow(store) flash('You are not following %s anymore.' % storename) return redirect(url_for('.store', id=store.id))
def unfollow(username): to_unfollow = User.query.filter_by(username=username).first() if to_unfollow is None: flash('Invalid user.') return redirect(url_for('.index')) if not current_user.is_following(to_unfollow): flash('You are not following %s.' % username) return redirect(url_for('.user', username=username)) current_user.unfollow(to_unfollow) flash("You've unfollowed %s." % username) return redirect(url_for(".user", username=to_unfollow.username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'错误的用户。') return redirect(url_for('.index')) if not current_user.is_following(user): flash(u'你已经取消了对该用户的关注') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(u'你不能再关注 %s 了。' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid User.', 'danger') return redirect(url_for('.index')) if not current_user.is_following(user): flash('You are not following this user.', 'warning') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash('You are no longer following %s.' % username, 'warning') return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'非法用户') return redirect(url_for('.index')) if not current_user.is_following(user): flash(u'没有关注该用户') return redirect(url_for('.profile', id=user.id)) current_user.unfollow(user) flash (u'已经对该用户取消关注') return redirect(url_for('.profile', id=user.id))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid User.') return redirect(url_for('main.index')) if not current_user.is_following(user): flash('You didn\'t follow this user.') return redirect(url_for('main.user_profile', username=username)) current_user.unfollow(user) flash('You have unfollowed %s.' % username) return redirect(url_for('main.user_profile', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid user.') return redirect(url_for('.index')) if current_user.is_following(user): flash('You have unfollowed this user.') current_user.unfollow(user) return redirect(url_for('.user', username=username)) flash('You can not unfollow this user.') return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('无效的用户') return redirect(url_for('.index')) if not current_user.is_following(user): flash('你还没有关注这位用户') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash('你现在不再关注 %s.' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash("No such loser user") return redirect(url_for(".index")) if not current_user.is_following(user): flash("Hey, you are not following them to begin with") return redirect(url_for(".user", username=username)) current_user.unfollow(user) flash("Hey, you have unfollowed {}".format(user)) return redirect(url_for(".user", username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'非法用户。') return redirect(url_for('.index')) if not current_user.is_following(user): flash(u'你已经取消关注该用户.') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(u'你不再是 %s 的粉丝.' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid user.') return redirect(url_for('.index')) if current_user.unfollow(user): flash('You have already following this user.') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash('You have unfollowed %s.' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid user','danger') return redirect(url_for('.index')) if not current_user.is_following(user): flash('You are not following this user.') return redirect(usr_for('.user',username=username)) current_user.unfollow(user) flash('You are not following %s now.' % username,'success') return redirect(url_for('.user',username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'有户不存在') return redirect(url_for('.index')) if not current_user.is_following(user): flash(u'你还不是他的粉丝') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(u'已粉转路 %s' % user.username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash("Invalid User") return redirect(url_for(".index")) if not current_user.is_following(user): flash("You are not following this user") return redirect(url_for(".user", username=username)) current_user.unfollow(user) flash("You are not following %s anymore" % username) return redirect(url_for(".user", username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if not user: flash('Invalid user.') return redirect(url_for('.index')) if not current_user.is_following(user): flash('You are not following this user.') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash('You haven\'t been followed %s yet.' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid user.') return redirect(url_for('site.index')) if not current_user.is_following(user): flash("You are already don't following this user.") return redirect(url_for('profile.view_profile', username=username)) current_user.unfollow(user) flash('You are now unfollow %s.' % username) return redirect(url_for('profile.view_profile', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid User!') redirect(url_for('.index')) if current_user.is_following(user): flash('You are not this user\'s follower') redirect(url_for('.user', username=username)) current_user.unfollow(user) flash('Now you are not this user\'s follower') return redirect(url_for('.user', username=username))
def unfollow(username): to_unfollow = User.query.filter_by(username=username).first() if to_unfollow is None: flash('Invalid user.') return redirect(url_for('.index')) if not current_user.is_following(to_unfollow): flash('You are not following %s.' % username) return redirect(url_for('.user', username=username)) current_user.unfollow(to_unfollow) flash("You've unfollowed %s." % username) return redirect(url_for(".user", username=to_unfollow.username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('Invalid user.') return redirect(url_for('.index')) if not current_user.is_following(user): flash('You do not follow this user.') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash('You have unfollowed %s' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'无效的用户名') return redirect(url_for('.index')) if not current_user.is_following(user): flash(u'您没有关注此用户') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(u'您已经取消的对%s的关注' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'非法用户!') return redirect(url_for('main.index')) if not current_user.is_following(user): flash(u'你没有关注他!') return redirect(url_for('main.user_page', username=username)) current_user.unfollow(user) flash(u'你不再关注 %s ' % username) return redirect(url_for('main.user_page', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('无效的用户') return redirect(url_for('.index')) if not user.is_following(user): flash('你没有关注此用户') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash('你已取消对{{user.username}}的关注') return redirect(url_for('.user', username=user.username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'无效的用户名!') return redirect(url_for('.index')) if not current_user.is_following(user): flash(u'你还没有关注该用户!') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(u'你已经取消关注 %s。' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('无效用户') return redirect(url_for('.index')) if not current_user.is_following(user): flash('您没有关注此用户') return redirect(url_for('.profile', username=username)) current_user.unfollow(user) flash('您已取消对此用户的关注') return redirect(url_for('.profile', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash("Invalid user.") return redirect(url_for(".index")) if not current_user.is_following(user): flash("You are not following this user.") return redirect(url_for(".user", username=username)) current_user.unfollow(user) flash("You are not following %s anymore." % username) return redirect(url_for(".user", username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash(u'用户不存在') return redirect(url_for('.index')) if not current_user.is_following(user): flash(u'您还没有关注这个用户.') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash(u'取消关注 %s ' % username) return redirect(url_for('.user', username=username))
def unfollow(username): user = User.query.filter_by(username=username).first() if user is None: flash('无效的用户') return redirect(url_for('.index')) if not current_user.is_following(user): flash('你还没有关注这位用户') return redirect(url_for('.user', username=username)) current_user.unfollow(user) flash('你现在不再关注 %s.' % username) return redirect(url_for('.user', username=username))