def uncollect(id): post = Post.query.get(id) if post is None: flash('the post_id is not valid') return redirect(url_for('main.index')) current_user.uncollect(post) return redirect(request.referrer)
def uncollect(photo_id): photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): flash('Not collect yet.', 'info') return redirect(url_for('.show_photo', photo_id=photo_id)) current_user.uncollect(photo) flash('Photo uncollected.', 'success') return redirect(url_for('.show_photo', photo_id=photo_id))
def uncollect_post(post_id: int): if not current_user.is_authenticated: return jsonify(message="Login required."), 401 post = Post.query.get_or_404(post_id) current_user.uncollect(post) if not current_user.is_collecting(post): return {"message": "ok"}, 200 return {"message": "failed"}, 400
def uncollect(photo_id): photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): flash('还没有收藏', 'info') return redirect(url_for('main.show_photo', photo_id=photo_id)) current_user.uncollect(photo) flash('已取消收藏', 'info') return redirect(url_for('.show_photo', photo_id=photo_id))
def uncollect(id): post = Post.query.get_or_404(id) if not current_user.collecting(post): flash('你没有收藏这篇文章!') return redirect(url_for('public.details', id=post.id)) current_user.uncollect(post) flash('取消收藏成功!') return redirect(url_for('public.details', id=post.id))
def uncollect(id): post = Post.query.get_or_404(id) if not current_user.is_collecting(post): flash('你还没有收藏此文章!', 'info') return redirect(url_for('posts.show_post', id=id)) current_user.uncollect(post) flash('收藏已取消!', 'info') return redirect_back()
def uncollect(post_id): post = Post.query.get_or_404(post_id) if not current_user.is_collecting(post): flash('该文章未收藏!', 'info') return redirect_back() current_user.uncollect(post) return redirect_back()
def uncollect(photo_id): photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): flash("Not collect yet.", category="info") return redirect(url_for("main.show_photo", photo_id=photo_id)) current_user.uncollect(photo) flash("Photo uncollected.", category="info") return redirect(url_for("main.show_photo", photo_id=photo_id))
def uncollect(photo_id): photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): flash('You have not colleted this photo yet', 'info') return redirect(url_for('main.show_photo', photo_id=photo_id)) current_user.uncollect(photo) flash('Photo uncollected', 'info') return redirect(url_for('main.show_photo', photo_id=photo_id))
def uncollect(photo_id): if not current_user.is_authenticated: return jsonify(message='Login required.'), 403 photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): return jsonify(message='No collect yet.') current_user.uncollect(photo) return jsonify(message='Collect canceled')
def uncollect(photo_id): if not current_user.is_authenticated: return jsonify(message='用户未登录'), 401 photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): return jsonify(message='你还没有收藏这张图片'), 400 current_user.uncollect(photo) return jsonify(message='取消收藏成功')
def collect(post_id): post = Post.query.filter_by(id=post_id).first() if current_user.is_collecting(post): current_user.uncollect(post) db.session.commit() return jsonify(count=post.collectors.count(), collection_type=0) current_user.collect(post) db.session.commit() return jsonify(count=post.collectors.count(), collection_type=1)
def uncollect(photo_id): photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): flash('Фото еще не в коллекции', 'info') return redirect(url_for('.show_photo', photo_id=photo_id)) current_user.uncollect(photo) flash('Фото убрано из коллекци', 'info') return redirect(url_for('.show_photo', photo_id=photo_id))
def uncollect(photo_id): """取消收藏""" photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): flash('没有收藏过图片.', 'info') return redirect(url_for('main.show_photo', photo_id=photo_id)) current_user.uncollect(photo) return redirect_back()
def uncollect(blog_id): blog = Blog.query.get_or_404(blog_id) if not current_user.is_collecting(blog): flash('Not collect yet.', 'info') return redirect(url_for('blog.show_photo', blog_id=blog_id)) current_user.uncollect(blog) flash('Photo uncollected.', 'info') return redirect(url_for('blog.show_photo', blog_id=blog_id))
def uncollect(travel_id): travel = Travels.query.get_or_404(travel_id) if not current_user.is_collecting(travel): flash('您还未收藏此游记', 'info') return redirect(url_for('main.show_travels', travel_id=travel_id)) current_user.uncollect(travel) flash('取消收藏成功.', 'info') return redirect(url_for('main.show_travels', travel_id=travel_id))
def uncollect(topic_id): topic = Topic.query.get_or_404(topic_id) if not current_user.is_collecting(topic): flash('还没有收藏此帖子', 'info') return redirect(url_for('main.show_topic', topic_id=topic_id)) current_user.uncollect(topic) flash('已取消收藏此帖子。', 'success') return redirect(url_for('main.show_topic', topic_id=topic_id))
def uncollect(photo_id): photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): flash("Not collected yet", "warning") return redirect(url_for('.show_photo', photo_id=photo_id)) current_user.uncollect(photo) flash("Photo Uncollected", 'success') return redirect(url_for('.show_photo', photo_id=photo_id))
def uncollect(post_id): post = Post.query.get_or_404(post_id) if not current_user.is_collecting(post): flash('你并没有收藏过该博文。', 'info') return redirect(url_for('.show_post', post_id=post_id)) current_user.uncollect(post) flash('已取消收藏该博文。', 'info') return redirect(url_for('.show_post', post_id=post_id))
def uncollect(post_id): post = Post.query.get_or_404(post_id) if not current_user.is_collecting(post): flash('文章没有被收藏.', 'info') return redirect(url_for('main.show_post', post_id=post_id)) current_user.uncollect(post) flash('文章已被取消收藏', 'info') return redirect(url_for('main.show_post', post_id=post_id))
def uncollect(photo_id): if not current_user.is_authenticated: return jsonify(message='请先登录!'), 403 photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): return jsonify(message='还没有收藏。'), 400 current_user.uncollect(photo) return jsonify(message='取消收藏成功。')
def uncollect(article_id): if not current_user.is_authenticated: return jsonify(message='Login required.'), 403 article = Article.query.get_or_404(article_id) if not current_user.is_collecting(article): return jsonify(message='Not collect yet.'), 400 current_user.uncollect(article) return jsonify(message='Collect canceled.')
def uncollect(blog_id): if not current_user.is_authenticated: return jsonify(message='Login required.'), 403 blog = Blog.query.get_or_404(blog_id) if not current_user.is_collecting(blog): return jsonify(message='Not collect yet.'), 400 current_user.uncollect(blog) return jsonify(message='Collect canceled.')
def uncollect(photo_id): if not current_user.is_authenticated: return jsonify(message=_l('Необходимо войти')), 403 photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): return jsonify(message=_l('Фото еще не в коллекции.')), 400 current_user.uncollect(photo) return jsonify(message=_l('Фото больше не в коллекции.'))
def uncollect(photo_id): if not current_user.is_authenticated: return jsonify(message='需要登录'), 403 photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): return jsonify(message='还没有关注该图片哦'), 400 current_user.uncollect(photo) return jsonify(message='取消关注成功')
def uncollect(photo_id): if not current_user.is_authenticated: return jsonify(message='Требуется войти в свою учетную запись'), 403 photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): return jsonify(message='Еще не в коллекции. Not collect yet.'), 400 current_user.uncollect(photo) return jsonify(message='Убрано из коллекции')
def uncollect(id): article=Article.query.get_or_404(id) if article is None: flash('没有该文章') return redirect(url_for('main.index')) if not current_user.is_collect(article): flash('您还没有收藏该文章') return redirect(url_for('main.index')) current_user.uncollect(article) flash('取消成功') return redirect(url_for('main.article',id=id))
def uncollect(photo_id): """取消收藏""" if not current_user.is_authenticated: return jsonify(message='请先登陆.'), 403 photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): return jsonify(message='没有收藏过.'), 400 current_user.uncollect(photo) return jsonify(message='收藏取消.')
def uncollect(photo_id): if not current_user.is_authenticated: return jsonify(message="Login required"), 403 photo = Photo.query.get_or_404(photo_id) if not current_user.is_collecting(photo): return jsonify(message="Not yet collected"), 400 current_user.uncollect(photo) if current_user != photo.author and photo.author.receive_collect_notification: push_collect_notification(current_user, photo_id, photo.author) return jsonify(message="Photo uncollected")
def uncollect(photo_id): """ 取消收藏 :param photo_id: 图片id """ logger.info('url = ' + str(request.url)) logger.info('取消收藏的用户名: {},图片ID: {}'.format(current_user.username, photo_id)) photo = Photo.query.get_or_404(photo_id) # 如果没有收藏图片,则直接返回 if not current_user.is_collecting(photo): flash("没有收藏过该图片,无法取消!", "info") return redirect(url_for("main.show_photo", photo_id=photo_id)) # 取消收藏 current_user.uncollect(photo) flash("取消收藏成功!", "info") return redirect(url_for(".show_photo", photo_id=photo_id))
def video_uncollect(id): video = Video.query.get_or_404(id) if current_user.uncollect(video): # flash('视频已经从收藏中移除') return 'True:' + str(video.collecters.count()) else: # flash('额, 发生未知错误, 请重试') return 'False:' + str(video.collecters.count())