Use suitable name route
This commit is contained in:
@@ -302,7 +302,7 @@ def add_tag():
|
|||||||
return redirect(url_for('tags'))
|
return redirect(url_for('tags'))
|
||||||
|
|
||||||
@app.route('/editTag/<tag_id>')
|
@app.route('/editTag/<tag_id>')
|
||||||
def editTag(tag_id):
|
def edit_tag(tag_id):
|
||||||
if not session.get('logged_in'):
|
if not session.get('logged_in'):
|
||||||
return redirect(url_for('login'))
|
return redirect(url_for('login'))
|
||||||
db = get_db()
|
db = get_db()
|
||||||
@@ -315,8 +315,8 @@ def editTag(tag_id):
|
|||||||
tag = cur.fetchone()
|
tag = cur.fetchone()
|
||||||
return render_template('editTag.html', tag=tag)
|
return render_template('editTag.html', tag=tag)
|
||||||
|
|
||||||
@app.route('/edit_tag', methods=['POST'])
|
@app.route('/updateTag', methods=['POST'])
|
||||||
def edit_tag():
|
def update_tag():
|
||||||
if not session.get('logged_in'):
|
if not session.get('logged_in'):
|
||||||
return redirect(url_for('login'))
|
return redirect(url_for('login'))
|
||||||
db = get_db()
|
db = get_db()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<h2>Edit Tag #{{ tag.id }}</h2>
|
<h2>Edit Tag #{{ tag.id }}</h2>
|
||||||
<form action="{{ url_for('edit_tag') }}" method="post" class="tagForm">
|
<form action="{{ url_for('update_tag') }}" method="post" class="tagForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="tagName">Tag name</label>
|
<label for="tagName">Tag name</label>
|
||||||
<input type="text" name="tagName" id="tagName" class="form-control" value="{{ tag.tagName|e }}">
|
<input type="text" name="tagName" id="tagName" class="form-control" value="{{ tag.tagName|e }}">
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
{% for tag in tags %}
|
{% for tag in tags %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ url_for('editTag', tag_id=tag.id) }}" class="btn btn-xs btn-primary"><i class="fa fa-pencil" aria-hidden="true"></i></a>
|
<a href="{{ url_for('edit_tag', tag_id=tag.id) }}" class="btn btn-xs btn-primary"><i class="fa fa-pencil" aria-hidden="true"></i></a>
|
||||||
</td>
|
</td>
|
||||||
<td class="tagContent">
|
<td class="tagContent">
|
||||||
<h4>
|
<h4>
|
||||||
|
|||||||
Reference in New Issue
Block a user