stars fixes
This commit is contained in:
1 parent
c9871b95e1
commit
45af09da0d
2 files changed
+6
-1
No files matched your search
@@ -80,16 +80,18 @@ async def s_api_v1_content_view(request, content_address: str):
|
||||
if request.ctx.user.telegram_id in [5587262915, 6861699286]:
|
||||
stars_cost = 2
|
||||
|
||||
invoice_id = f"access_{uuid.uuid4().hex}"
|
||||
exist_invoice = request.ctx.db_session.query(StarsInvoice).filter(
|
||||
and_(
|
||||
StarsInvoice.user_id == request.ctx.user.id,
|
||||
StarsInvoice.created > datetime.now() - timedelta(minutes=25),
|
||||
StarsInvoice.amount == stars_cost,
|
||||
StarsInvoice.external_id == invoice_id
|
||||
)
|
||||
).first()
|
||||
if exist_invoice:
|
||||
invoice_url = exist_invoice.invoice_url
|
||||
else:
|
||||
invoice_id = f"access_{uuid.uuid4().hex}"
|
||||
invocie_url = None
|
||||
try:
|
||||
invoice_url = await Bot(token=CLIENT_TELEGRAM_API_KEY).create_invoice_link(
|
||||
|
||||
Reference in new issue
Block a user