fix important
This commit is contained in:
parent
181d980e48
commit
1b9a965869
|
|
@ -61,13 +61,13 @@ async def s_api_v1_content_view(request, content_address: str):
|
||||||
(content['encrypted_content'].owner_address == user_wallet_address)
|
(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',
|
or bool(request.ctx.db_session.query(UserContent).filter_by(owner_address=user_wallet_address, status='active',
|
||||||
content_id=content['encrypted_content'].id).first()) \
|
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_(
|
and_(
|
||||||
StarsInvoice.user_id == request.ctx.user.id,
|
StarsInvoice.user_id == request.ctx.user.id,
|
||||||
StarsInvoice.content_hash == content['encrypted_content'].hash,
|
StarsInvoice.content_hash == content['encrypted_content'].hash,
|
||||||
StarsInvoice.paid == True
|
StarsInvoice.paid == True
|
||||||
)
|
)
|
||||||
))
|
).first())
|
||||||
)
|
)
|
||||||
if not have_access:
|
if not have_access:
|
||||||
stars_cost = 1 # TODO: как считать стоимость в звездах?
|
stars_cost = 1 # TODO: как считать стоимость в звездах?
|
||||||
|
|
|
||||||
|
|
@ -170,13 +170,13 @@ class PlayerTemplates:
|
||||||
have_access = (
|
have_access = (
|
||||||
(content.owner_address == user_wallet_address)
|
(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_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_(
|
and_(
|
||||||
StarsInvoice.user_id == self.user.id,
|
StarsInvoice.user_id == self.user.id,
|
||||||
StarsInvoice.content_hash == content.hash,
|
StarsInvoice.content_hash == content.hash,
|
||||||
StarsInvoice.paid == True
|
StarsInvoice.paid == True
|
||||||
)
|
)
|
||||||
))
|
).first())
|
||||||
)
|
)
|
||||||
if have_access:
|
if have_access:
|
||||||
full_content = self.db_session.query(StoredContent).filter_by(
|
full_content = self.db_session.query(StoredContent).filter_by(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue