zxc
This commit is contained in:
parent
c4614261a3
commit
7719a3d074
1 changed files with 7 additions and 4 deletions
|
@ -121,9 +121,11 @@ def get_post(i, v=None, graceful=False):
|
||||||
)
|
)
|
||||||
|
|
||||||
items=items.one_or_none()
|
items=items.one_or_none()
|
||||||
|
|
||||||
|
if not items:
|
||||||
|
if graceful: return None
|
||||||
|
else: abort(404)
|
||||||
|
|
||||||
if not items and not graceful:
|
|
||||||
abort(404)
|
|
||||||
x = items[0]
|
x = items[0]
|
||||||
x.voted = items[1] or 0
|
x.voted = items[1] or 0
|
||||||
x.is_blocking = items[2] or 0
|
x.is_blocking = items[2] or 0
|
||||||
|
@ -131,8 +133,9 @@ def get_post(i, v=None, graceful=False):
|
||||||
items = g.db.query(
|
items = g.db.query(
|
||||||
Submission
|
Submission
|
||||||
).filter(Submission.id == i).one_or_none()
|
).filter(Submission.id == i).one_or_none()
|
||||||
if not items and not graceful:
|
if not items:
|
||||||
abort(404)
|
if graceful: return None
|
||||||
|
else: abort(404)
|
||||||
x=items
|
x=items
|
||||||
|
|
||||||
return x
|
return x
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue