changeset 3842:f40bd4c68aa2

MoinMoin.user: fix MoinMoinBugs/DuplicateNewUserNotification
author Johannes Berg <johannes AT sipsolutions DOT net>
date Mon, 14 Jul 2008 13:03:42 +0200
parents e676cbf8b1e3
children eb8df08f88f5 6aeb3f0af92c
files MoinMoin/user.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/user.py	Sat Jun 28 15:36:31 2008 +0200
+++ b/MoinMoin/user.py	Mon Jul 14 13:03:42 2008 +0200
@@ -326,7 +326,7 @@
         self.tz_offset = int(float(self._cfg.tz_offset) * 3600)
         self.language = ""
         self.real_language = "" # In case user uses "Browser setting". For language-statistics
-        self._loaded = False
+        self._stored = False
         self.date_fmt = ""
         self.datetime_fmt = ""
         self.quicklinks = self._cfg.quicklinks_default
@@ -494,8 +494,9 @@
         if not self.disabled:
             self.valid = 1
 
-        # Mark this user as loaded from disk, so UserCreatedEvent is not sent
-        self._loaded = True
+        # Mark this user as stored so saves don't send
+        # the "user created" event
+        self._stored = True
 
         # If user data has been changed, save fixed user data.
         if changed:
@@ -633,7 +634,8 @@
         if not self.disabled:
             self.valid = 1
 
-        if not self._loaded:
+        if not self._stored:
+            self._stored = True
             event = events.UserCreatedEvent(self._request, self)
             events.send_event(event)