forked from rDrama/rDrama
fix 500 error on devrama
parent
26b9feea2c
commit
31e263fe9d
|
@ -140,7 +140,11 @@ def poster_of_the_day_id():
|
||||||
user = db.query(User, func.sum(Post.upvotes)).join(Post, Post.author_id == User.id).filter(
|
user = db.query(User, func.sum(Post.upvotes)).join(Post, Post.author_id == User.id).filter(
|
||||||
Post.created_utc > t,
|
Post.created_utc > t,
|
||||||
User.admin_level == 0,
|
User.admin_level == 0,
|
||||||
).group_by(User).order_by(func.sum(Post.upvotes).desc()).first()[0]
|
).group_by(User).order_by(func.sum(Post.upvotes).desc()).one_or_none()
|
||||||
|
|
||||||
|
if not user: return SNAPPY_ID
|
||||||
|
|
||||||
|
user = user[0]
|
||||||
|
|
||||||
t = datetime.datetime.now()
|
t = datetime.datetime.now()
|
||||||
send_notification(user.id, f":marseyjam: You're the Top Poster of the Day for the day of {t.year}-{t.month}-{t.day} :marseyjam:")
|
send_notification(user.id, f":marseyjam: You're the Top Poster of the Day for the day of {t.year}-{t.month}-{t.day} :marseyjam:")
|
||||||
|
|
Loading…
Reference in New Issue