# HG changeset patch # User Marcin Kuzminski # Date 2017-03-03 17:24:13 # Node ID 7a6b1bb9c9ae6196f790b2c5c3b603f0b49bad7c # Parent a630e423c764d7e44f79f2f572b8875ef299c13c auth-tokens: order tokens by creation id. diff --git a/rhodecode/model/auth_token.py b/rhodecode/model/auth_token.py --- a/rhodecode/model/auth_token.py +++ b/rhodecode/model/auth_token.py @@ -85,6 +85,8 @@ class AuthTokenModel(BaseModel): user_auth_tokens = user_auth_tokens\ .filter(or_(UserApiKeys.expires == -1, UserApiKeys.expires >= time.time())) + user_auth_tokens = user_auth_tokens.order_by( + UserApiKeys.user_api_key_id) return user_auth_tokens def get_auth_token(self, auth_token):