fix(user): don't prevent deleting a user if their default project was shared
Resolves https://kolaente.dev/vikunja/api/issues/1595
This commit is contained in:
parent
49d8713388
commit
693a77ae51
@ -138,7 +138,9 @@ func DeleteUser(s *xorm.Session, u *user.User) (err error) {
|
|||||||
|
|
||||||
for _, p := range projectsToDelete {
|
for _, p := range projectsToDelete {
|
||||||
err = p.Delete(s, u)
|
err = p.Delete(s, u)
|
||||||
if err != nil {
|
// If the user is the owner of the default project it will be deleted, if they are not the owner
|
||||||
|
// we can ignore the error as the project was shared in that case.
|
||||||
|
if err != nil && !IsErrCannotDeleteDefaultProject(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user