]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/modules/__init__.py
fix breach in award points that allows user to award infinite points
[osqa.git] / forum / modules / __init__.py
index f1ad7d96bb167a936ea87756b8dfb695a7384cf4..6942c9115e491886b5bcf6a6f104ec7aaaa07bd3 100644 (file)
@@ -16,15 +16,10 @@ def get_modules_script(script_name):
 
         try:
             all.append(__import__('%s.%s' % (m.__name__, script_name), globals(), locals(), [m.__name__]))
-        except ImportError, e:
-            #print repr(type(e)) + m.__name__ + ":" + str(e)
-            pass
-        except:
-            import traceback
-            msg = "Error importing %s from module %s: \n %s" % (
-                script_name, m, traceback.format_exc()
-            )
-            logging.error(msg)
+        except Exception, e:
+            if isinstance(e, ImportError) and str(e).endswith(script_name):
+                continue
+            logging.exception("Error importing %s from module %s", script_name, m)
 
     return all