def open(email,blogtitle,blog_id): if utils.email_is_valid(email) == True and blog_id.__len__() == 32: item = Users.bytitle_one(blogtitle) ids = Users.id_one(blog_id)["_id"] if session['user'] == email and ids == blog_id: items = Users.bytitle(blogtitle) return render_template('blogopen.html',items=items) else: flash("there is a problem contact Admin") return redirect(url_for('login')) flash("there is a problem please contact admin") return redirect(url_for('login'))
def commentdetails(blogtitle,email,blog_id): if blog_id.__len__() == 32: ids = Users.id_one(blog_id)['_id'] if blog_id == ids and ids != False: item = Users.bytitle_one(blogtitle) totalcomment = Users.allcomments(blogtitle) blogs = Users.bytitle(blogtitle) return render_template('totalcomment.html',totalcomment=totalcomment,blogs=blogs) else: flash(" big problem ") return redirect(url_for('login')) flash("big problem man") return redirect(url_for('login'))