Skip to content

Commit

Permalink
Don't show disabled (locked) users
Browse files Browse the repository at this point in the history
Fixes: #1210
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Aug 7, 2023
1 parent c600b1d commit 1df3221
Show file tree
Hide file tree
Showing 7 changed files with 2,987 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/1210.bug
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't show disabled (locked) users in Noggin
4 changes: 3 additions & 1 deletion noggin/controller/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def search_json(ipa):
if username:
users_ = [
User(u)
for u in ipa.user_find(username, fasuser=True, sizelimit=10)['result']
for u in ipa.user_find(
username, fasuser=True, o_nsaccountlock=False, sizelimit=10
)['result']
]

for user_ in users_:
Expand Down
5 changes: 4 additions & 1 deletion noggin/utility/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ def group_or_404(ipa, groupname):

def user_or_404(ipa, username):
try:
return ipa.user_show(a_uid=username)['result']
user = ipa.user_show(a_uid=username)['result']
except python_freeipa.exceptions.NotFound:
abort(404)
if User(user).locked:
abort(404)
return user
Loading

0 comments on commit 1df3221

Please sign in to comment.