Skip to content

Commit a3fbbea

Browse files
Add listing of users by matching note
1 parent 04d1ec6 commit a3fbbea

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

model/person.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def is_django_staff(self):
215215
def get_admin_note(note_type='admin_note'):
216216
"""Return a note on the account."""
217217
note = model.database.person_get_admin_note(note_type)
218-
return None if note == "None" else note
218+
return None if (note == "None" or note == "") else note
219219

220220
def set_admin_note(note, note_type='admin_note'):
221221
"""Set a note on the account."""

pages/user_list_page.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,13 @@ def no_login_name(user, dummy):
9898
login_name = model.database.person_get_login_name(user)
9999
return login_name is None or login_name == ""
100100

101+
def admin_note_match(user, pattern):
102+
note = user.get_admin_note()
103+
return note and re.search(pattern, note)
104+
101105
user_list_filters = {
102-
'name': name_match,
106+
'name_matching': name_match,
107+
'admin_note_matching': admin_note_match,
103108
'date_joined_before': joined_before,
104109
'date_joined_after': joined_after,
105110
'no_email': no_email,

0 commit comments

Comments
 (0)