This commit is contained in:
Gaël
2025-09-17 10:48:16 +02:00
parent 8074e7df84
commit 595c11eeb5

View File

@@ -90,6 +90,7 @@ class GhostAdmin:
self.key_id, self.key_secret_hex = admin_key.split(":") self.key_id, self.key_secret_hex = admin_key.split(":")
self.accept_version = accept_version self.accept_version = accept_version
def _jwt(self) -> str: def _jwt(self) -> str:
iat = int(time.time()) iat = int(time.time())
payload = {"iat": iat, "exp": iat + 5 * 60, "aud": "/admin/"} payload = {"iat": iat, "exp": iat + 5 * 60, "aud": "/admin/"}
@@ -181,7 +182,7 @@ class GhostTask:
async def maybe_run_today(self): async def maybe_run_today(self):
if not self._published_today(): if not self._published_today():
LOG.info("Aucune newsletter publiée aujourd'hui génération immédiate.") LOG.info("Aucune newsletter publiée aujourd'hui -> génération immédiate.")
await self.daily_task() await self.daily_task()
else: else:
LOG.info("Déjà publié aujourd'hui, on attend la prochaine fenêtre.") LOG.info("Déjà publié aujourd'hui, on attend la prochaine fenêtre.")
@@ -245,7 +246,7 @@ class GhostTask:
- Images: collecte la première pour feature_image - Images: collecte la première pour feature_image
""" """
parts: List[str] = [] parts: List[str] = []
parts.append(f"<h2>Les news du {self._fr_date_today()}</h2>") #parts.append(f"<h2>Les news du {self._fr_date_today()}</h2>")
first_image: Optional[str] = None first_image: Optional[str] = None
for post in items: for post in items: