dfs
This commit is contained in:
parent
4e50221442
commit
3393756ae6
2 changed files with 4 additions and 4 deletions
|
@ -200,7 +200,7 @@ def award_post(pid, v):
|
||||||
AwardRelationship.submission_id == None,
|
AwardRelationship.submission_id == None,
|
||||||
AwardRelationship.comment_id == None
|
AwardRelationship.comment_id == None
|
||||||
)
|
)
|
||||||
).one_or_none()
|
).first()
|
||||||
|
|
||||||
if not post_award:
|
if not post_award:
|
||||||
return {"error": "You don't have that award."}, 404
|
return {"error": "You don't have that award."}, 404
|
||||||
|
@ -374,7 +374,7 @@ def award_comment(cid, v):
|
||||||
AwardRelationship.submission_id == None,
|
AwardRelationship.submission_id == None,
|
||||||
AwardRelationship.comment_id == None
|
AwardRelationship.comment_id == None
|
||||||
)
|
)
|
||||||
).one_or_none()
|
).first()
|
||||||
|
|
||||||
if not comment_award:
|
if not comment_award:
|
||||||
return {"error": "You don't have that award."}, 404
|
return {"error": "You don't have that award."}, 404
|
||||||
|
|
|
@ -584,7 +584,7 @@ def u_username(username, v=None):
|
||||||
ViewerRelationship.viewer_id == v.id,
|
ViewerRelationship.viewer_id == v.id,
|
||||||
ViewerRelationship.user_id == u.id
|
ViewerRelationship.user_id == u.id
|
||||||
)
|
)
|
||||||
).one_or_none()
|
).first()
|
||||||
|
|
||||||
if view:
|
if view:
|
||||||
view.last_view_utc = g.timestamp
|
view.last_view_utc = g.timestamp
|
||||||
|
@ -953,7 +953,7 @@ def fp(v, fp):
|
||||||
users += g.db.query(User).filter(User.email == v.email, User.is_activated, User.id != v.id).all()
|
users += g.db.query(User).filter(User.email == v.email, User.is_activated, User.id != v.id).all()
|
||||||
for u in users:
|
for u in users:
|
||||||
li = [v.id, u.id]
|
li = [v.id, u.id]
|
||||||
existing = g.db.query(Alt).filter(Alt.user1.in_(li), Alt.user2.in_(li)).one_or_none()
|
existing = g.db.query(Alt).filter(Alt.user1.in_(li), Alt.user2.in_(li)).first()
|
||||||
if existing: continue
|
if existing: continue
|
||||||
new_alt = Alt(user1=v.id, user2=u.id)
|
new_alt = Alt(user1=v.id, user2=u.id)
|
||||||
g.db.add(new_alt)
|
g.db.add(new_alt)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue