changeset 3792:4f1d2cd9879b

script.account.create: use same rule for email check than in MoinMoin.action.newaccount
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 24 Jun 2008 18:23:32 +0200
parents 7f43f5c38310
children 6e73d9be3e3f
files MoinMoin/script/account/create.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/script/account/create.py	Tue Jun 24 14:12:55 2008 +0200
+++ b/MoinMoin/script/account/create.py	Tue Jun 24 18:23:32 2008 +0200
@@ -67,9 +67,11 @@
         if user.User(request, name=self.options.uname).exists():
             print 'This username "%s" exists already!' % self.options.uname
             return
-        if user.get_by_email_address(request, self.options.email):
-            print 'This emailaddress "%s" belongs to someone else!' % self.options.email
-            return
+        # Email should be unique - see also MoinMoin.action.newaccount
+        if self.options.email and request.cfg.user_email_unique:
+            if user.get_by_email_address(request, self.options.email):
+                print 'This emailaddress "%s" belongs to someone else!' % self.options.email
+                return
         u = user.User(request, None, self.options.uname, password=self.options.password)
         u.email = self.options.email
         u.aliasname = self.options.ualiasname or ''