You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2016/01/19 22:58:09 UTC

[1/2] allura git commit: Allow any notification to be active, not just first

Repository: allura
Updated Branches:
  refs/heads/master 607bea2bc -> a9ed64eaf


Allow any notification to be active, not just first


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/073953a7
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/073953a7
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/073953a7

Branch: refs/heads/master
Commit: 073953a724f3385ee54f5f2137ddd534f771447a
Parents: 375e1d1
Author: Dave Brondsema <da...@brondsema.net>
Authored: Mon Jan 18 17:28:27 2016 -0500
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Mon Jan 18 17:34:56 2016 -0500

----------------------------------------------------------------------
 Allura/allura/model/notification.py            | 8 ++++----
 Allura/docs/getting_started/administration.rst | 3 +--
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/073953a7/Allura/allura/model/notification.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/notification.py b/Allura/allura/model/notification.py
index b9be654..dfde847 100644
--- a/Allura/allura/model/notification.py
+++ b/Allura/allura/model/notification.py
@@ -707,6 +707,9 @@ class SiteNotification(MappedClass):
     class __mongometa__:
         session = main_orm_session
         name = 'site_notification'
+        indexes = [
+            ('active', '_id'),
+        ]
 
     _id = FieldProperty(S.ObjectId)
     content = FieldProperty(str, if_missing='')
@@ -717,10 +720,7 @@ class SiteNotification(MappedClass):
     page_regex = FieldProperty(str, if_missing=None)
     page_tool_type = FieldProperty(str, if_missing=None)
 
-
     @classmethod
     def current(cls):
-        note = cls.query.find().sort('_id', -1).limit(1).first()
-        if note is None or not note.active:
-            return None
+        note = cls.query.find({'active': True}).sort('_id', -1).limit(1).first()
         return note
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/073953a7/Allura/docs/getting_started/administration.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/administration.rst b/Allura/docs/getting_started/administration.rst
index 50a3f0f..9ed2f3d 100644
--- a/Allura/docs/getting_started/administration.rst
+++ b/Allura/docs/getting_started/administration.rst
@@ -328,8 +328,7 @@ which have role 'Developer' or higher in one of their projects.  And if url of
 the current page is matching regex :code:`(Home|browse_pages)` and app
 tool type is :code:`wiki`.  An "Impressions" value of 0 will show the
 notification indefinitely (until closed).  The notification content can contain
-HTML.  Only the most recent notification will be shown, unless it has
-"Active" unchecked, in which case no notification will be shown.
+HTML.  Only the most recent active notification will be shown.
 "User Role", "Page Regex" and "Page Type" are optional.
 
 .. _delete-projects:


[2/2] allura git commit: Allow any notification to be active, not just first notification

Posted by he...@apache.org.
Allow any notification to be active, not just first notification


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a9ed64ea
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a9ed64ea
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a9ed64ea

Branch: refs/heads/master
Commit: a9ed64eafea71939d1eaf8aebe2ae2114823a0b9
Parents: 607bea2 073953a
Author: Heith Seewald <he...@gmail.com>
Authored: Tue Jan 19 16:55:54 2016 -0500
Committer: Heith Seewald <he...@gmail.com>
Committed: Tue Jan 19 16:57:59 2016 -0500

----------------------------------------------------------------------
 Allura/allura/model/notification.py            | 8 ++++----
 Allura/docs/getting_started/administration.rst | 3 +--
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------