fix important

This commit is contained in:
user 2025-03-01 12:48:15 +03:00
parent 181d980e48
commit 1b9a965869
2 changed files with 4 additions and 4 deletions

View File

@ -61,13 +61,13 @@ async def s_api_v1_content_view(request, content_address: str):
(content['encrypted_content'].owner_address == user_wallet_address)
or bool(request.ctx.db_session.query(UserContent).filter_by(owner_address=user_wallet_address, status='active',
content_id=content['encrypted_content'].id).first()) \
or bool(request.ctx.db_session.query(UserContent).filter(
or bool(request.ctx.db_session.query(StarsInvoice).filter(
and_(
StarsInvoice.user_id == request.ctx.user.id,
StarsInvoice.content_hash == content['encrypted_content'].hash,
StarsInvoice.paid == True
)
))
).first())
)
if not have_access:
stars_cost = 1 # TODO: как считать стоимость в звездах?

View File

@ -170,13 +170,13 @@ class PlayerTemplates:
have_access = (
(content.owner_address == user_wallet_address)
or bool(self.db_session.query(UserContent).filter_by(owner_address=user_wallet_address, status='active', content_id=content.id).first())
or bool(self.db_session.query(UserContent).filter(
or bool(self.db_session.query(StarsInvoice).filter(
and_(
StarsInvoice.user_id == self.user.id,
StarsInvoice.content_hash == content.hash,
StarsInvoice.paid == True
)
))
).first())
)
if have_access:
full_content = self.db_session.query(StoredContent).filter_by(