This commit is contained in:
parent
8cc7e21338
commit
7cd7447796
|
@ -90,7 +90,7 @@ def check_to_unfeature(session, rejecter_id, reaction):
|
||||||
async def set_featured(session, shout_id):
|
async def set_featured(session, shout_id):
|
||||||
s = session.query(Shout).where(Shout.id == shout_id).first()
|
s = session.query(Shout).where(Shout.id == shout_id).first()
|
||||||
s.featured_at = int(time.time())
|
s.featured_at = int(time.time())
|
||||||
Shout.update(s, { 'featured_at': int(time.time()) })
|
Shout.update(s, {'featured_at': int(time.time())})
|
||||||
author = session.query(Author).filter(Author.id == s.created_by).first()
|
author = session.query(Author).filter(Author.id == s.created_by).first()
|
||||||
if author:
|
if author:
|
||||||
await add_user_role(str(author.user))
|
await add_user_role(str(author.user))
|
||||||
|
@ -100,7 +100,7 @@ async def set_featured(session, shout_id):
|
||||||
|
|
||||||
def set_unfeatured(session, shout_id):
|
def set_unfeatured(session, shout_id):
|
||||||
s = session.query(Shout).where(Shout.id == shout_id).first()
|
s = session.query(Shout).where(Shout.id == shout_id).first()
|
||||||
Shout.update(s, {'featured_at': None })
|
Shout.update(s, {'featured_at': None})
|
||||||
session.add(s)
|
session.add(s)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user