This commit is contained in:
parent
caa2dbfdf3
commit
53a0f2e328
|
@ -18,6 +18,7 @@ async def get_drafts(_, info):
|
|||
user_id = info.context["user_id"]
|
||||
with local_session() as session:
|
||||
author = session.query(Author).filter(Author.user == user_id).first()
|
||||
if author:
|
||||
q = (
|
||||
select(Shout)
|
||||
.options(
|
||||
|
@ -39,6 +40,7 @@ async def create_shout(_, info, inp):
|
|||
user_id = info.context["user_id"]
|
||||
with local_session() as session:
|
||||
author = session.query(Author).filter(Author.user == user_id).first()
|
||||
if author:
|
||||
topics = session.query(Topic).filter(Topic.slug.in_(inp.get("topics", []))).all()
|
||||
authors = inp.get("authors", [])
|
||||
if author.id not in authors:
|
||||
|
@ -83,6 +85,7 @@ async def update_shout(_, info, shout_id, shout_input=None, publish=False):
|
|||
user_id = info.context["user_id"]
|
||||
with local_session() as session:
|
||||
author = session.query(Author).filter(Author.user == user_id).first()
|
||||
if author:
|
||||
shout = (
|
||||
session.query(Shout)
|
||||
.options(
|
||||
|
|
Loading…
Reference in New Issue
Block a user