changeset 2300:754a1727e0ca

fix broken checking of being subscribed to NonExistent items
author Ana Balica <ana.balica@gmail.com>
date Wed, 30 Oct 2013 11:32:25 +0100
parents 01dced4292d8
children 25a934c60b30
files MoinMoin/user.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/user.py	Tue Oct 29 20:47:54 2013 +0100
+++ b/MoinMoin/user.py	Wed Oct 30 11:32:25 2013 +0100
@@ -574,14 +574,12 @@
         :rtype: bool
         :returns: if user is subscribed to the item
         """
-        if not self.valid:
+        from MoinMoin.items import NonExistent
+        if not self.valid or isinstance(item, NonExistent):
             return False
 
         meta = item.meta
-        try:
-            item_namespace = meta[NAMESPACE]
-        except KeyError:
-            return False
+        item_namespace = meta[NAMESPACE]
         subscriptions = {"{0}:{1}".format(ITEMID, meta[ITEMID])}
         subscriptions.update("{0}:{1}:{2}".format(NAME, item_namespace, name)
                              for name in meta[NAME])