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 <aurelien@bompard.org>
  • Loading branch information
abompard committed Jul 21, 2023
1 parent ccc5dd4 commit f8641f4
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
@@ -0,0 +1 @@
Don't show disabled (locked) users in Noggin
4 changes: 3 additions & 1 deletion noggin/controller/root.py
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
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

0 comments on commit f8641f4

Please sign in to comment.