forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2022-02-05 23:58:37 +02:00
parent 35cb378758
commit bcd58d1a7b
2 changed files with 3 additions and 4 deletions

View File

@ -93,8 +93,7 @@ def publish(pid, v):
def submit_get(v, sub=None):
if sub: sub = g.db.query(Sub.name).filter_by(name=sub).one_or_none()
if sub: sub = sub[0]
elif request.path.startswith('/s/'): abort(404)
if request.path.startswith('/s/') and not sub: abort(404)
return render_template("submit.html", v=v, sub=sub)

View File

@ -63,7 +63,7 @@
<div class="submit-grid-view">
<form id="submitform" action="{% if sub %}/s/{{sub}}{% endif %}/submit" method="post" enctype="multipart/form-data" style="grid-column: 2">
<form id="submitform" action="{% if sub %}/s/{{sub.name}}{% endif %}/submit" method="post" enctype="multipart/form-data" style="grid-column: 2">
<div class="container">
@ -88,7 +88,7 @@
general
</option>
{% for s in SUBS %}
<option value="{{s}}" {% if sub == s %}selected{% endif %}>
<option value="{{s}}" {% if sub.name == s %}selected{% endif %}>
/s/{{s}}
</option>
{% endfor %}