allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shalithasura...@apache.org
Subject [allura] branch ss/8285 updated: [#8285] Add audit log and some wording fixes
Date Sat, 03 Aug 2019 07:06:24 GMT
This is an automated email from the ASF dual-hosted git repository.

shalithasuranga pushed a commit to branch ss/8285
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/ss/8285 by this push:
     new 8a6ab1e  [#8285] Add audit log and some wording fixes
8a6ab1e is described below

commit 8a6ab1e7af71487ceaf9f90741d8799b3db1b9a8
Author: Shalitha Suranga <shalithasuranga@gmail.com>
AuthorDate: Sat Aug 3 12:35:46 2019 +0530

    [#8285] Add audit log and some wording fixes
---
 Allura/allura/controllers/auth.py      | 7 ++++++-
 Allura/allura/templates/user_subs.html | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index 057a8d8..2ca07c7 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -1222,7 +1222,12 @@ class SubscriptionsController(BaseController):
     @expose()
     @require_post()
     def update_user_notifications(self, allow_umnotif=False):
-        c.user.set_pref('mention_notifications', allow_umnotif and True or False)
+        allow_notif = bool(allow_umnotif)
+        c.user.set_pref('mention_notifications', allow_notif)
+        if allow_notif:
+            h.auditlog_user('User mention notifications are enabled')
+        else:
+            h.auditlog_user('User mention notifications are disabled')
         redirect(request.referer or '/')
 
 
diff --git a/Allura/allura/templates/user_subs.html b/Allura/allura/templates/user_subs.html
index 82e7491..a04931b 100644
--- a/Allura/allura/templates/user_subs.html
+++ b/Allura/allura/templates/user_subs.html
@@ -39,7 +39,7 @@
   <form method="POST" action="update_user_notifications">
   <div class="grid-10">
       <input type="checkbox" id="allow_umnotif" name="allow_umnotif" {% if c.user.get_pref('mention_notifications')
%} checked {% endif %}>
-      <label for="allow_umnotif">Send a notification via e-mail if my username is mentioned
in somewhere</label>
+      <label for="allow_umnotif">Send a notification via e-mail if my username is mentioned
somewhere</label>
   </div>
   <div class="grid-2">
       <input class="submit" type="submit" value="Save">


Mime
View raw message