fix some errors
This commit is contained in:
parent
6f5082b860
commit
78bf9ffec8
|
|
@ -91,7 +91,7 @@ async def s_api_v1_auth_twa(request):
|
|||
make_log("auth", f"Invalid ton_proof: {e}", level="warning")
|
||||
return response.json({"error": "Invalid ton_proof"}, status=400)
|
||||
|
||||
ton_connection = (await request.ctx.db_session.execute(select(WalletConnection).where(
|
||||
ton_connection = (request.ctx.db_session.execute(select(WalletConnection).where(
|
||||
and_(
|
||||
WalletConnection.user_id == known_user.id,
|
||||
WalletConnection.network == 'ton',
|
||||
|
|
|
|||
|
|
@ -114,14 +114,21 @@ class StoredContent(AlchemyBase, AudioContentMixin):
|
|||
]:
|
||||
extra_fields[k] = self.meta.get(k, None)
|
||||
|
||||
spec_field_updated = self.updated.isoformat() if isinstance(self.updated, datetime) else (
|
||||
datetime.fromisoformat(self.updated).isoformat() if isinstance(self.updated, str) else None
|
||||
)
|
||||
spec_field_created = self.created.isoformat() if isinstance(self.created, datetime) else (
|
||||
datetime.fromisoformat(self.created).isoformat() if isinstance(self.created, str) else None
|
||||
)
|
||||
|
||||
return {
|
||||
**extra_fields,
|
||||
"hash": self.hash,
|
||||
"cid": self.cid.serialize_v2(),
|
||||
"content_type": self.meta.get('content_type', 'application/x-binary'),
|
||||
"status": self.status,
|
||||
"updated": self.updated.isoformat() if isinstance(self.updated, datetime) else (make_log("Content.json_format", f"Invalid Content.updated: {self.updated} ({type(self.updated)})", level="error") or None),
|
||||
"created": self.created.isoformat() if isinstance(self.created, datetime) else (make_log("Content.json_format", f"Invalid Content.created: {self.created} ({type(self.created)})", level="error") or None),
|
||||
"created": spec_field_created,
|
||||
"updated": spec_field_updated,
|
||||
}
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
Loading…
Reference in New Issue