filter published for layouts, unset publishedAt
This commit is contained in:
parent
941f8cdd71
commit
8c880ff9ea
|
@ -125,6 +125,8 @@ def set_published(session, slug, publisher):
|
|||
def set_hidden(session, slug):
|
||||
s = session.query(Shout).where(Shout.slug == slug).first()
|
||||
s.visibility = 'authors'
|
||||
s.publishedAt = None # TODO: discuss
|
||||
s.publishedBy = None # TODO: store changes history in git
|
||||
session.add(s)
|
||||
session.commit()
|
||||
|
||||
|
@ -134,8 +136,6 @@ def set_hidden(session, slug):
|
|||
async def create_reaction(_, info, inp):
|
||||
user = info.context["request"].user
|
||||
|
||||
# TODO: filter allowed for post reaction kinds
|
||||
|
||||
with local_session() as session:
|
||||
reaction = Reaction.create(**inp)
|
||||
session.add(reaction)
|
||||
|
|
|
@ -136,10 +136,11 @@ async def shouts_by_layout(param, info, layout, amount=100, offset=0):
|
|||
# for layout in ['image', 'audio', 'video', 'literature']:
|
||||
shouts_by_layout = list(ShoutsCache.by_layout.get(layout, []))
|
||||
for s in shouts_by_layout:
|
||||
if s.visibility == 'public': # if bool(s.publishedAt):
|
||||
shouts[s.slug] = s
|
||||
for a in s.authors:
|
||||
a.caption = await ShoutAuthorStorage.get_author_caption(s.slug, a.slug)
|
||||
# if bool(s.publishedAt):
|
||||
shouts[s.slug] = s
|
||||
|
||||
shouts_prepared = list(shouts.values())
|
||||
|
||||
# TODO: pick keyfunc according to kind of query
|
||||
|
|
Loading…
Reference in New Issue
Block a user