minor submission changes
parent
c057d1baf1
commit
ee756bf4b6
|
@ -95,7 +95,10 @@ def get_account(id, v=None, graceful=False):
|
||||||
except: abort(404)
|
except: abort(404)
|
||||||
|
|
||||||
user = g.db.get(User, id)
|
user = g.db.get(User, id)
|
||||||
if not user and not graceful: abort(404)
|
|
||||||
|
if not user:
|
||||||
|
if not graceful: abort(404)
|
||||||
|
else: return None
|
||||||
|
|
||||||
if v:
|
if v:
|
||||||
block = g.db.query(UserBlock).filter(
|
block = g.db.query(UserBlock).filter(
|
||||||
|
|
|
@ -12,13 +12,13 @@ from files.routes.static import marsey_list
|
||||||
@auth_required
|
@auth_required
|
||||||
def original_marseys(v):
|
def original_marseys(v):
|
||||||
images = listdir("/asset_submissions/marseys/original")
|
images = listdir("/asset_submissions/marseys/original")
|
||||||
return render_template("asset_submissions.html", v=v, images=images)
|
return render_template("original_assets.html", v=v, images=images, type="marseys")
|
||||||
|
|
||||||
@app.get('/hats/original')
|
@app.get('/hats/original')
|
||||||
@auth_required
|
@auth_required
|
||||||
def original_hats(v):
|
def original_hats(v):
|
||||||
images = listdir("/asset_submissions/hats/original")
|
images = listdir("/asset_submissions/hats/original")
|
||||||
return render_template("asset_submissions.html", v=v, images=images)
|
return render_template("original_assets.html", v=v, images=images, type="hats")
|
||||||
|
|
||||||
@app.get('/asset_submissions/<path:path>')
|
@app.get('/asset_submissions/<path:path>')
|
||||||
@limiter.exempt
|
@limiter.exempt
|
||||||
|
@ -76,8 +76,10 @@ def submit_marsey(v):
|
||||||
if not tags_regex.fullmatch(tags):
|
if not tags_regex.fullmatch(tags):
|
||||||
return error("Invalid tags!")
|
return error("Invalid tags!")
|
||||||
|
|
||||||
author = request.values.get('author').strip()
|
username = request.values.get('author').strip()
|
||||||
author = get_user(author)
|
author = get_user(username, graceful=True)
|
||||||
|
if not author:
|
||||||
|
return error(f"A user with the name '{username}' was not found!")
|
||||||
|
|
||||||
highquality = f'/asset_submissions/marseys/{name}'
|
highquality = f'/asset_submissions/marseys/{name}'
|
||||||
file.save(highquality)
|
file.save(highquality)
|
||||||
|
@ -221,8 +223,10 @@ def submit_hat(v):
|
||||||
if not description_regex.fullmatch(description):
|
if not description_regex.fullmatch(description):
|
||||||
return error("Invalid description!")
|
return error("Invalid description!")
|
||||||
|
|
||||||
author = request.values.get('author').strip()
|
username = request.values.get('author').strip()
|
||||||
author = get_user(author)
|
author = get_user(username, graceful=True)
|
||||||
|
if not author:
|
||||||
|
return error(f"A user with the name '{username}' was not found!")
|
||||||
|
|
||||||
highquality = f'/asset_submissions/hats/{name}'
|
highquality = f'/asset_submissions/hats/{name}'
|
||||||
file.save(highquality)
|
file.save(highquality)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{loop.index}}</td>
|
<td>{{loop.index}}</td>
|
||||||
<td>{{image}}</td>
|
<td>{{image}}</td>
|
||||||
<td><img class="asset-submission" loading="lazy" alt="{{name}}" src="/asset_submissions/marseys/{{image}}"></td>
|
<td><img class="asset-submission" loading="lazy" alt="{{name}}" src="/asset_submissions/{{type}}/{{image}}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in New Issue