From 239961bb674216a7aaa6042b7b868af662c1fcda Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Mon, 16 Jul 2007 18:33:30 +0000
Subject: [PATCH] Use the else keyword instead of testing

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15230 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/ERP5Site.py | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/product/ERP5/ERP5Site.py b/product/ERP5/ERP5Site.py
index c9b940bf94..ebabf32380 100644
--- a/product/ERP5/ERP5Site.py
+++ b/product/ERP5/ERP5Site.py
@@ -937,19 +937,19 @@ class ERP5Site(FolderMixIn, CMFSite):
     expected_module_id = portal_type.lower().replace(' ','_')
     if portal_object._getOb(expected_module_id, None) is not None:
       module_id = expected_module_id
-    expected_module_id += '_module'
-    if module_id is None and portal_object._getOb(expected_module_id, None) \
-        is not None:
-      module_id = expected_module_id
-    # then look for module where the type is allowed
-    if module_id is None:
-      for expected_module_id in portal_object.objectIds(spec=('ERP5 Folder',)):
-        module = portal_object._getOb(expected_module_id, None)
-        if module is not None:
-          if portal_type in self.portal_types[module.getPortalType()].\
-                                    allowed_content_types:
-            module_id = expected_module_id
-            break
+    else:
+      expected_module_id += '_module'
+      if portal_object._getOb(expected_module_id, None) is not None:
+        module_id = expected_module_id
+      # then look for module where the type is allowed
+      else:
+        for expected_module_id in portal_object.objectIds(spec=('ERP5 Folder',)):
+          module = portal_object._getOb(expected_module_id, None)
+          if module is not None:
+            if portal_type in self.portal_types[module.getPortalType()].\
+                                      allowed_content_types:
+              module_id = expected_module_id
+              break
 
     if module_id is None:
       if default is not MARKER:
-- 
2.30.9