mas: fix tests

This commit is contained in:
Roman Isaev 2025-01-25 00:56:19 +00:00
parent 0b4cf3badd
commit 27f7a5e3eb
No known key found for this signature in database
GPG key ID: 7BE2B6A6C89AEC7F
2 changed files with 21 additions and 10 deletions

View file

@ -801,6 +801,23 @@ func AdminAllowCrossSigningReplacementWithoutUIA(
}
}
var rs api.QueryAccountByLocalpartResponse
err = userAPI.QueryAccountByLocalpart(req.Context(), &api.QueryAccountByLocalpartRequest{
Localpart: userID.Local(),
ServerName: userID.Domain(),
}, &rs)
if err != nil && !errors.Is(err, sql.ErrNoRows) {
util.GetLogger(req.Context()).WithError(err).Error("userAPI.QueryAccountByLocalpart")
return util.JSONResponse{
Code: http.StatusInternalServerError,
JSON: spec.Unknown(err.Error()),
}
} else if errors.Is(err, sql.ErrNoRows) {
return util.JSONResponse{
Code: http.StatusNotFound,
JSON: spec.NotFound("User not found."),
}
}
switch req.Method {
case http.MethodPost:
ts := sessions.allowCrossSigningKeysReplacement(userID.String())