##// END OF EJS Templates
db: use consistent order of auth-tokens and emails when fetching those from user.
marcink -
r1981:339c39a8 default
parent child Browse files
Show More
@@ -615,7 +615,10 b' class User(Base, BaseModel):'
615
615
616 @property
616 @property
617 def emails(self):
617 def emails(self):
618 other = UserEmailMap.query().filter(UserEmailMap.user == self).all()
618 other = UserEmailMap.query()\
619 .filter(UserEmailMap.user == self) \
620 .order_by(UserEmailMap.email_id.asc()) \
621 .all()
619 return [self.email] + [x.email for x in other]
622 return [self.email] + [x.email for x in other]
620
623
621 @property
624 @property
@@ -624,7 +627,10 b' class User(Base, BaseModel):'
624 return [x.api_key for x in auth_tokens]
627 return [x.api_key for x in auth_tokens]
625
628
626 def get_auth_tokens(self):
629 def get_auth_tokens(self):
627 return UserApiKeys.query().filter(UserApiKeys.user == self).all()
630 return UserApiKeys.query()\
631 .filter(UserApiKeys.user == self)\
632 .order_by(UserApiKeys.user_api_key_id.asc())\
633 .all()
628
634
629 @property
635 @property
630 def feed_token(self):
636 def feed_token(self):
General Comments 0
You need to be logged in to leave comments. Login now