diff --git a/rhodecode/lib/db_manage.py b/rhodecode/lib/db_manage.py --- a/rhodecode/lib/db_manage.py +++ b/rhodecode/lib/db_manage.py @@ -269,7 +269,7 @@ class DbManage(object): email = defaults.get('email') if username is None: - username = raw_input('Specify admin username:') + username = input('Specify admin username:') if password is None: password = self._get_admin_password() if not password: @@ -278,7 +278,7 @@ class DbManage(object): if not password: sys.exit() if email is None: - email = raw_input('Specify admin email:') + email = input('Specify admin email:') api_key = self.cli_args.get('api_key') self.create_user(username, password, email, True, strict_creation_check=False, @@ -517,7 +517,7 @@ class DbManage(object): if _path is not None: path = _path elif not self.tests and not test_repo_path: - path = raw_input( + path = input( 'Enter a valid absolute path to store repositories. ' 'All repositories in that path will be added automatically:' ) diff --git a/rhodecode/lib/pagination.py b/rhodecode/lib/pagination.py --- a/rhodecode/lib/pagination.py +++ b/rhodecode/lib/pagination.py @@ -291,14 +291,15 @@ class _Page(list): # wrapper class can execute a query with the knowledge of what the # slice will be (for efficiency) and, in the same query, ask for the # total number of items and only execute one query. + try: first = (self.page - 1) * items_per_page last = first + items_per_page self.items = list(self.collection[first:last]) except TypeError as err: raise TypeError( - "Your collection of type {} cannot be handled " - "by paginate. ERROR:{}".format(type(self.collection), err) + f"Your collection of type {type(self.collection)} cannot be handled " + f"by paginate. ERROR:{err}" ) # Unless the user tells us how many items the collections has