Move post/comment ID boilerplate inside getters.
Borrows code from the upstream which has been working in production reliably for ~months. Also, most of it was literally copy-pasted, and the casted ID values aren't used later in the route functions.
This commit is contained in:
parent
1018cf3412
commit
c85cd469a1
6 changed files with 10 additions and 36 deletions
|
@ -7,10 +7,6 @@ from files.helpers.assetcache import assetcache_path
|
|||
|
||||
@app.template_filter("post_embed")
|
||||
def post_embed(id, v):
|
||||
|
||||
try: id = int(id)
|
||||
except: return None
|
||||
|
||||
p = get_post(id, v, graceful=True)
|
||||
|
||||
if p: return render_template("submission_listing.html", listing=[p], v=v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue