From e76ed4c3e6d0f3049016c51c1d921daf734161b8 Mon Sep 17 00:00:00 2001 From: bug_creator Date: Tue, 30 Nov 2021 22:30:19 +0800 Subject: [PATCH] fix bug --- app/main/views.py | 9 +++++---- data-dev.sqlite | Bin 6885376 -> 6885376 bytes 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/main/views.py b/app/main/views.py index ea04e36..17e2220 100644 --- a/app/main/views.py +++ b/app/main/views.py @@ -892,7 +892,7 @@ def new_question_md(): is_anonymous = False if title == "": flash("Title cannot be None!") - return render_template('new_posting/new_mdpost.html', form=form) + return render_template('new_posting/new_mdpost.html', form=form,default_body="",default_title="") body_html = request.form['test-editormd-html-code'] question = Question(title=title, body=body, @@ -907,7 +907,7 @@ def new_question_md(): else: flash("You have just posted a posting", 'success') return redirect(url_for('.index')) - return render_template('new_posting/new_mdquestion.html', form=form) + return render_template('new_posting/new_mdquestion.html', form=form,default_body="",default_title="") @main.route('/edit_question_md/', methods=['GET', 'POST']) @@ -924,7 +924,8 @@ def edit_question_md(question_id): is_anonymous = False if title == "": flash("Title cannot be None!") - return render_template('new_posting/new_mdpost.html', form=form) + return render_template('new_posting/new_mdquestion.html', form=form,default_title=question.title, + default_body=question.body) body_html = request.form['test-editormd-html-code'] question.title = title question.body = body @@ -971,7 +972,7 @@ def new_answer_md(question_id): else: flash("You have just posted a posting", 'success') return redirect(url_for('.view_question', question_id=question_id)) - return render_template('new_posting/new_mdanswer.html', form=form) + return render_template('new_posting/new_mdanswer.html', form=form,default_body="") @main.route('/edit_answer_md/', methods=['GET', 'POST']) diff --git a/data-dev.sqlite b/data-dev.sqlite index bd7be6363ef65ff34f3dae311633f40d28c1a02f..acb662a567cb4aed0204a24fcb22ec3b6c349057 100644 GIT binary patch delta 996 zcmZ|OOH30{6b9gXJ5DK`wu6X>fKsSdL|Z!3GJS|Z1s{kAD82xtAfP0efIC;T3#kUh zHYlU91~iStg&5;wNEF?;Gck~`V&jIE8W&&!D?{`LSH_x~Z*$J#ymI|xQN|CUY(q^E zA?h$8svJTXYq(HS)f5GMZ+tY`N^51-M<1%xCgq8bR{Bza0a#E&3TPk|w7`K5^k4uU(qJQ` z!zRdp&5#LOAPcraHsnAqY=iBP2S%k&oj>w`wO~d5pl&Q53cv(AU?-Si7Zk#7D1tq( z7c5|fVz7Y#BG?t(m}9wIt0#m|K1BG?t9<_e-+v`g&k-V2dQ&xC4UOLjC&q8aKFIU$ zM&>7P$0o0r_Le0H7WbCvwg2B<^32-dG$>E5cD8j~Gq!j4^mGULC5OTkLr*LM% z5Ag*Clm3}*nKK(A=rD~_%-^Lpraz19uWnv%@>?(*S6(JQM&kDaj7CcYXZ3n~VQ4Tm z5sbecMAxy9y!d`J@j{73$72(36BE&e$msl3Wa0T;43s>cd?vwZ72Pf|*X90asP&X& z7u|BfqV$#He~?ey9L3%06y1_EKsEYCZVqo&nM!kdw94#H$xqez0=EKn!KPISoZtdC zcwirt!hR@&a;N|=9Dquwf`f1f4#N?shNDme$DkID!&;qsXn+%N5*pzYoQ5-S7S2Hv eG(!uVhYQdOK4^n>xCkB430-hWXQ*T=DC!WU-%nrlm^_qvA}a~8aKZ4 zT(^@D5>_Ndu94*$CFqnTUH0pK#T!zjpr(?yi9vw_Gw>il0a&0AtRR97>`(*_D25GC z0vllyY=%0 z{ZIp5s09gRP{7A*Y5!`Y8PB#G_V?yjZ1#ycQh8H-p_xAx3!;ZOk`7mq+dgeu6+O?Z z;w2*Ue9?Nj8&jk{+7&6ZL@b{Z<9YUUdG