do not fail if anon user == manager, simply emit warning that it should not be done in production. stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 12 Nov 2009 09:33:55 +0100
branchstable
changeset 3822 b61c7b065a66
parent 3821 653ddc1e4179
child 3823 94aa250cff9b
do not fail if anon user == manager, simply emit warning that it should not be done in production. close #469395
misc/migration/postcreate.py
--- a/misc/migration/postcreate.py	Thu Nov 12 09:27:26 2009 +0100
+++ b/misc/migration/postcreate.py	Thu Nov 12 09:33:55 2009 +0100
@@ -34,7 +34,10 @@
 # create anonymous user if all-in-one config and anonymous user has been specified
 if hasattr(config, 'anonymous_user'):
     anonlogin, anonpwd = config.anonymous_user()
-    if anonlogin:
+    if anonlogin == session.user.login:
+        print 'you are using a manager account as anonymous user.'
+        print 'Hopefully this is not a production instance...'
+    elif anonlogin:
         rql('INSERT CWUser X: X login %(login)s, X upassword %(pwd)s,'
             'X in_group G WHERE G name "guests"',
             {'login': unicode(anonlogin), 'pwd': anonpwd})