Skip to content

Commit

Permalink
fixed add new post in main.py and edit.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj1998 committed Aug 15, 2018
1 parent a01441b commit 8d6455a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def edit(sno):
db.session.commit()
return redirect('/edit/'+sno)
post = Posts.query.filter_by(sno=sno).first()
return render_template('edit.html', params=params, post=post)
return render_template('edit.html', params=params, post=post, sno=sno)


@app.route("/uploader", methods = ['GET', 'POST'])
Expand Down
2 changes: 1 addition & 1 deletion templates/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1>Basic Actions</h1>
<h1>Add/Edit Post</h1>


<form name="sentMessage" id="contactForm" action = "/edit/{{post.sno}}" method="post" novalidate>
<form name="sentMessage" id="contactForm" action = "/edit/{{sno}}" method="post" novalidate>
<div class="control-group">
<div class="form-group floating-label-form-group controls">
<label>Title</label>
Expand Down

0 comments on commit 8d6455a

Please sign in to comment.