Skip to content

Commit

Permalink
fix user creation and deletion
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed Dec 7, 2021
1 parent a3702f7 commit 505776b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ocs/pkg/service/v0/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/cs3org/reva/pkg/rgrpc/todo/pool"
"github.com/cs3org/reva/pkg/token/manager/jwt"
"github.com/go-chi/chi/v5"
"github.com/google/uuid"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/ocs/pkg/service/v0/data"
"github.com/owncloud/ocis/ocs/pkg/service/v0/response"
Expand Down Expand Up @@ -197,7 +198,7 @@ func (o Ocs) AddUser(w http.ResponseWriter, r *http.Request) {
}

newAccount := &accounts.Account{
Id: userid,
Id: uuid.New().String(),
DisplayName: displayname,
PreferredName: userid,
OnPremisesSamAccountName: userid,
Expand Down Expand Up @@ -463,7 +464,7 @@ func (o Ocs) DeleteUser(w http.ResponseWriter, r *http.Request) {
return
}

if purgeRecycleResponse.Status.Code != rpcv1beta1.Code_CODE_OK {
if purgeRecycleResponse.Status.Code != rpcv1beta1.Code_CODE_OK && purgeRecycleResponse.Status.Code != rpcv1beta1.Code_CODE_NOT_FOUND {
o.logger.Error().
Str("stat_status_code", statResp.Status.Code.String()).
Str("stat_message", statResp.Status.Message).
Expand Down

0 comments on commit 505776b

Please sign in to comment.