mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 05:17:07 +02:00
46 lines
1.7 KiB
Diff
46 lines
1.7 KiB
Diff
From 3b491ef042b55006e42698f6dcc1f0748fbba8d5 Mon Sep 17 00:00:00 2001
|
|
From: Julia Schroeder <julia.schroeder@grommunio.com>
|
|
Date: Wed, 13 Mar 2024 11:05:16 +0100
|
|
Subject: [PATCH] Only return user objects for ResetPasswd endpoints
|
|
|
|
---
|
|
api/__init__.py | 2 +-
|
|
endpoints/domain/users.py | 4 ++--
|
|
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/api/__init__.py b/api/__init__.py
|
|
index c2d08ae..f4e2cb6 100644
|
|
--- a/api/__init__.py
|
|
+++ b/api/__init__.py
|
|
@@ -7,7 +7,7 @@
|
|
|
|
apiSpec = None # API specification
|
|
apiVersion = None # API specification version. Extracted from the OpenAPI document.
|
|
-backendVersion = "1.15.0" # Backend version number
|
|
+backendVersion = "1.15.1" # Backend version number
|
|
|
|
|
|
def _loadOpenApiSpec():
|
|
diff --git a/endpoints/domain/users.py b/endpoints/domain/users.py
|
|
index c8bb9f1..bd649ba 100644
|
|
--- a/endpoints/domain/users.py
|
|
+++ b/endpoints/domain/users.py
|
|
@@ -37,7 +37,7 @@
|
|
def resetPasswd(username):
|
|
checkPermissions(ResetPasswdPermission())
|
|
from orm.users import Users
|
|
- user = Users.query.filter(Users.username == username).first()
|
|
+ user = Users.query.filter(Users.username == username, Users.maildir != "").first()
|
|
if not user:
|
|
return jsonify(message="User not found."), 404
|
|
if user.externID:
|
|
@@ -53,7 +53,7 @@ def resetPasswd(username):
|
|
def usernames():
|
|
checkPermissions(ResetPasswdPermission())
|
|
from orm.users import Users
|
|
- users = defaultListQuery(Users, (Users.ID != 0, Users.status == 0), result="list")
|
|
+ users = defaultListQuery(Users, (Users.ID != 0, Users.status == 0, Users.maildir != ""), result="list")
|
|
return jsonify(data=[{"username": user.username} for user in users])
|
|
|
|
|