Forum : barre « Répondre à ce sujet… » en bas, réponse et bulletin sur la page pleine largeur avec éditeur Markdown
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cette révision appartient à :
1 Parent
1e7d2413cf
révision
8be8c48571
4 fichiers modifiés
+85
-14
Aucun fichier ne correspond à votre recherche
@@ -410,7 +410,7 @@ class Forum:
|
||||
self.con.commit()
|
||||
self.version += 1
|
||||
|
||||
def repondre(self, user, topic_id, corps, ip=None):
|
||||
def repondre(self, user, topic_id, corps, ip=None, format_="texte"):
|
||||
self._exiger(user, "repondre")
|
||||
t, _ = self.sujet(user, topic_id)
|
||||
if t["locked"]:
|
||||
@@ -419,8 +419,10 @@ class Forum:
|
||||
raise Refus("sujet en attente de validation")
|
||||
if not t["replies_open"] and not self._peut(user, "publier_bulletin"):
|
||||
raise Refus("sujet fermé aux réponses")
|
||||
cur = self.con.execute("INSERT INTO posts(topic_id, author_id, body, ip) VALUES (?, ?, ?, ?)",
|
||||
(topic_id, user["id"], self._texte(corps, CORPS_MAX, "message"), ip))
|
||||
if format_ not in ("texte", "md"):
|
||||
raise Invalide("format inconnu")
|
||||
cur = self.con.execute("INSERT INTO posts(topic_id, author_id, body, ip, format) VALUES (?, ?, ?, ?, ?)",
|
||||
(topic_id, user["id"], self._texte(corps, CORPS_MAX, "message"), ip, format_))
|
||||
self.con.commit()
|
||||
return cur.lastrowid
|
||||
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur