<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Add a require_comment configuration directive.

This allows the comment to be made mandatory, with an appropriate save error
when no comment is filled in.
--- a/action/edit.py
+++ b/action/edit.py
@@ -161,6 +161,8 @@
             from MoinMoin.security.textcha import TextCha
             if not TextCha(request).check_answer_from_form():
                 raise pg.SaveError(_('TextCha: Wrong answer! Go back and try again...'))
+            if request.cfg.require_comment and not comment:
+                raise pg.SaveError(_('Supplying a comment is mandatory. Go back, write a comment and try again...'))
             savemsg = pg.saveText(savetext, rev, trivial=trivial, comment=comment)
         except pg.EditConflict, e:
             msg = e.message
--- a/config/multiconfig.py
+++ b/config/multiconfig.py
@@ -954,6 +954,7 @@
     ('edit_locking', 'warn 10', "Editor locking policy: `None`, `'warn &lt;timeout in minutes&gt;'`, or `'lock &lt;timeout in minutes&gt;'`"),
     ('edit_ticketing', True, None),
     ('edit_rows', 20, "Default height of the edit box"),
+    ('require_comment', False, "if True, only allow saving when a comment is filled in"),
 
   )),
   # ==========================================================================
</pre></body></html>