allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] allura git commit: [#1699] Remove redundant parameter from find_page method
Date Wed, 09 May 2018 15:16:54 GMT
Repository: allura
Updated Branches:
  refs/heads/master 5d37665f6 -> 1587b2ee2


[#1699] Remove redundant parameter from find_page method


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/1587b2ee
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1587b2ee
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1587b2ee

Branch: refs/heads/master
Commit: 1587b2ee23d8d13838b34d20f21736897593f840
Parents: 93a40e6
Author: deshanigtk <deshani.14@cse.mrt.ac.lk>
Authored: Wed May 9 08:00:44 2018 +0530
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Wed May 9 11:11:59 2018 -0400

----------------------------------------------------------------------
 ForgeWiki/forgewiki/model/wiki.py | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/1587b2ee/ForgeWiki/forgewiki/model/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/model/wiki.py b/ForgeWiki/forgewiki/model/wiki.py
index 7e31ebb..9df36e9 100644
--- a/ForgeWiki/forgewiki/model/wiki.py
+++ b/ForgeWiki/forgewiki/model/wiki.py
@@ -227,22 +227,13 @@ class Page(VersionedArtifact, ActivityObject):
             return ss
 
     @classmethod
-    def find_page(cls, title, version=None):
+    def find_page(cls, title):
         """Find page with `title`"""
-        if version is None:
-            # Check for existing page object
-            obj = cls.query.get(
-                app_config_id=context.app.config._id,
-                title=title)
-            return obj
-        else:
-            pg = cls.find_page(title)
-            if pg is not None:
-                HC = cls.__mongometa__.history_class
-                ss = HC.query.find(
-                    {'artifact_id': pg._id, 'version': int(version)}).one()
-                return ss
-            return pg
+        # Check for existing page object
+        obj = cls.query.get(
+            app_config_id=context.app.config._id,
+            title=title)
+        return obj
 
     @classmethod
     def attachment_class(cls):


Mime
View raw message