changeset 6116:1e52ed5c37aa

db: remove deprecated getAll method Not sure why this wasn't done immediately when get_all was added. Maybe search and replace was out of order at the time.
author Søren Løvborg <sorenl@unity3d.com>
date Wed, 03 Aug 2016 15:31:23 +0200
parents f4c712ab3e40
children 974d6470cbec
files kallithea/controllers/api/api.py kallithea/lib/paster_commands/update_repoinfo.py kallithea/model/__init__.py kallithea/model/db.py kallithea/model/repo.py kallithea/tests/functional/test_home.py kallithea/tests/other/manual_test_vcs_operations.py
diffstat 7 files changed, 7 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/api/api.py	Wed Aug 03 16:16:38 2016 +0200
+++ b/kallithea/controllers/api/api.py	Wed Aug 03 15:31:23 2016 +0200
@@ -457,7 +457,7 @@
             user = get_user_or_error(userid)
 
         # show all locks
-        for r in Repository.getAll():
+        for r in Repository.get_all():
             userid, time_ = r.locked
             if time_:
                 _api_data = r.get_api_data()
--- a/kallithea/lib/paster_commands/update_repoinfo.py	Wed Aug 03 16:16:38 2016 +0200
+++ b/kallithea/lib/paster_commands/update_repoinfo.py	Wed Aug 03 15:31:23 2016 +0200
@@ -59,7 +59,7 @@
 
 
         if self.options.repo_update_list is None:
-            repo_list = Repository.getAll()
+            repo_list = Repository.get_all()
         else:
             repo_names = [safe_unicode(n.strip())
                           for n in self.options.repo_update_list.split(',')]
--- a/kallithea/model/__init__.py	Wed Aug 03 16:16:38 2016 +0200
+++ b/kallithea/model/__init__.py	Wed Aug 03 15:31:23 2016 +0200
@@ -138,4 +138,4 @@
         """
         Returns all instances of what is defined in `cls` class variable
         """
-        return cls.cls.getAll()
+        return cls.cls.get_all()
--- a/kallithea/model/db.py	Wed Aug 03 16:16:38 2016 +0200
+++ b/kallithea/model/db.py	Wed Aug 03 15:31:23 2016 +0200
@@ -134,11 +134,6 @@
         return res
 
     @classmethod
-    def getAll(cls):
-        # deprecated and left for backward compatibility
-        return cls.get_all()
-
-    @classmethod
     def get_all(cls):
         return cls.query().all()
 
--- a/kallithea/model/repo.py	Wed Aug 03 16:16:38 2016 +0200
+++ b/kallithea/model/repo.py	Wed Aug 03 15:31:23 2016 +0200
@@ -180,7 +180,7 @@
     @classmethod
     def update_repoinfo(cls, repositories=None):
         if repositories is None:
-            repositories = Repository.getAll()
+            repositories = Repository.get_all()
         for repo in repositories:
             repo.update_changeset_cache()
 
--- a/kallithea/tests/functional/test_home.py	Wed Aug 03 16:16:38 2016 +0200
+++ b/kallithea/tests/functional/test_home.py	Wed Aug 03 15:31:23 2016 +0200
@@ -17,7 +17,7 @@
         #if global permission is set
         response.mustcontain('Add Repository')
         # html in javascript variable:
-        response.mustcontain('var data = {"totalRecords": %s' % len(Repository.getAll()))
+        response.mustcontain('var data = {"totalRecords": %s' % len(Repository.get_all()))
         response.mustcontain(r'href=\"/%s\"' % HG_REPO)
 
         response.mustcontain(r'<span class="repotag">git')
--- a/kallithea/tests/other/manual_test_vcs_operations.py	Wed Aug 03 16:16:38 2016 +0200
+++ b/kallithea/tests/other/manual_test_vcs_operations.py	Wed Aug 03 15:31:23 2016 +0200
@@ -527,7 +527,7 @@
             assert 'abort: HTTP Error 403: Forbidden' in stderr
         finally:
             #release IP restrictions
-            for ip in UserIpMap.getAll():
+            for ip in UserIpMap.get_all():
                 UserIpMap.delete(ip.ip_id)
             Session().commit()
 
@@ -553,7 +553,7 @@
             assert re.search(r'\b403\b', stderr)
         finally:
             #release IP restrictions
-            for ip in UserIpMap.getAll():
+            for ip in UserIpMap.get_all():
                 UserIpMap.delete(ip.ip_id)
             Session().commit()