remotes/1693045480750635534/spooky-22
Aevann1 2022-01-02 14:10:01 +02:00
parent 8a6d1a4323
commit e5d8c6e5ed
2 changed files with 4 additions and 4 deletions

View File

@ -200,7 +200,7 @@ def award_post(pid, v):
AwardRelationship.submission_id == None,
AwardRelationship.comment_id == None
)
).one_or_none()
).first()
if not post_award:
return {"error": "You don't have that award."}, 404
@ -374,7 +374,7 @@ def award_comment(cid, v):
AwardRelationship.submission_id == None,
AwardRelationship.comment_id == None
)
).one_or_none()
).first()
if not comment_award:
return {"error": "You don't have that award."}, 404

View File

@ -584,7 +584,7 @@ def u_username(username, v=None):
ViewerRelationship.viewer_id == v.id,
ViewerRelationship.user_id == u.id
)
).one_or_none()
).first()
if view:
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()
for u in users:
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
new_alt = Alt(user1=v.id, user2=u.id)
g.db.add(new_alt)