autocomplete: improve the lookup of value_display by re-using the object.
- in case of unicode email the previous method could generate wrong data, and make search not show up such users.
This commit is contained in:
parent
4647d1f908
commit
a7dabfc2c6
1 changed files with 3 additions and 1 deletions
|
|
@ -148,6 +148,7 @@ class RepoModel(BaseModel):
|
|||
qualified=True)
|
||||
|
||||
def get_users(self, name_contains=None, limit=20, only_active=True):
|
||||
|
||||
# TODO: mikhail: move this method to the UserModel.
|
||||
query = self.sa.query(User)
|
||||
if only_active:
|
||||
|
|
@ -171,8 +172,9 @@ class RepoModel(BaseModel):
|
|||
'first_name': user.name,
|
||||
'last_name': user.lastname,
|
||||
'username': user.username,
|
||||
'email': user.email,
|
||||
'icon_link': h.gravatar_url(user.email, 30),
|
||||
'value_display': h.person(user.email),
|
||||
'value_display': h.person(user),
|
||||
'value': user.username,
|
||||
'value_type': 'user',
|
||||
'active': user.active,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue