← Back to team overview

dhis2-devs team mailing list archive

[Bug 1429294] Re: Cannot Delete Users via Web API

 

I can confirm this. Currently, there is no check to see if the user has
associated objects which would prevent the deletion. What should happen
is that the system should check to see if there are any dependent
objects which would prevent the user from being deleted.There are a
large number of objects which are linked to "userinfo", but no checks to
see whether the deletion is possible. From the web interface, the UI
just spins with "Deleting...." forever if an exception is encountered.
Better feedback should be provided to users through the web informing
them that the operation was not possible. From the API a 409 Conflict?
should be returned (instead of a stack trace) to inform the client that
the operation could not be executed due to other objects which depend on
the user.

** Changed in: dhis2
       Status: New => Confirmed

** Summary changed:

- Cannot Delete Users via Web API
+ Cannot Delete Users when objects are linked to the user

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1429294

Title:
  Cannot Delete Users when objects are linked to the user

Status in DHIS:
  Confirmed

Bug description:
  I created a User, I then took that user's uid and tried to delete with
  the following.

  curl -X DELETE -u admin:district
  https://apps.dhis2.org/demo/api/users/Ix1ihxTPq4E

  I get an error back 
  org.postgresql.util.PSQLException: ERROR: update or delete on table "userinfo" violates foreign key constraint "fk6a68e08f19893da" on table "users"
    Detail: Key (userinfoid)=(240277) is still referenced from table "users".

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1429294/+subscriptions


References