mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 15:31:51 +08:00
allow null category id
This commit is contained in:
parent
61e521dda3
commit
c5f85d0d87
2
app.py
2
app.py
@ -169,7 +169,7 @@ def route_admin_songs_id_post(id):
|
|||||||
else:
|
else:
|
||||||
output['courses'][course] = None
|
output['courses'][course] = None
|
||||||
|
|
||||||
output['category_id'] = int(request.form.get('category_id'))
|
output['category_id'] = int(request.form.get('category_id')) or None
|
||||||
output['type'] = request.form.get('type')
|
output['type'] = request.form.get('type')
|
||||||
output['offset'] = float(request.form.get('offset')) or None
|
output['offset'] = float(request.form.get('offset')) or None
|
||||||
output['skin_id'] = int(request.form.get('skin_id')) or None
|
output['skin_id'] = int(request.form.get('skin_id')) or None
|
||||||
|
@ -65,6 +65,7 @@
|
|||||||
<div class="form-field">
|
<div class="form-field">
|
||||||
<p><label for="category_id">Category</label></p>
|
<p><label for="category_id">Category</label></p>
|
||||||
<select name="category_id" id="category_id">
|
<select name="category_id" id="category_id">
|
||||||
|
<option value="0">(none)</option>
|
||||||
{% for category in categories %}
|
{% for category in categories %}
|
||||||
<option value="{{ category.id }}"{% if song.category_id == category.id %} selected{% endif %}>{{ category.title }}</option>
|
<option value="{{ category.id }}"{% if song.category_id == category.id %} selected{% endif %}>{{ category.title }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user