#5327 closed defect (fixed)
Failure to delete user after using pump api
| Reported by: | Jonas Haraldsson | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | programming | Keywords: | api, db |
| Cc: | tsyesika | Parent Tickets: |
Description
User account deletion will fail with:
IntegrityError: (IntegrityError) FOREIGN KEY constraint failed u'DELETE FROM core__users WHERE core__users.id = ?' (7,) if the user have authenticated a client through the pump api.
gmg 0.8 with sqlite db
Change History (3)
comment:1 by , 10 years ago
| Cc: | added |
|---|
comment:2 by , 10 years ago
Is this still an issue as a lot of database changes have occurred. Please test against the current master.
comment:3 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Manually created a new 0.8.1 mediagoblin instance and a user loic. Authenticated via PyPump as follows:
>>> from pypump import PyPump, Client
>>> client = Client(webfinger="loic@testpump.gmg.the.re", type="native", name="test.io")
>>> pump = PyPump(client=client, verifier_callback=simple_verifier)
Go to: http://testpump.gmg.the.re/oauth/authorize?oauth_token=6ds2MZFlDT0epYdwF2cxBj5TMJNHqy
Verifier: yDTFtqzMgcMkyOuYlYlolKEJP6h0nx
>>> me = pump.Person("loic@testpump.gmg.the.re")
>>> me.summary
u'Yop'
>>>
On the machine running the mediagoblin instance:
root@gmg:~/mediagoblin-docker# docker exec -t -i testpump.web.1 bash
root@441c517a3f31:/# cd /srv/mediagoblin.example.org/mediagoblin/
cd /srv/mediagoblin.example.org/mediagoblin/
root@441c517a3f31:/srv/mediagoblin.example.org/mediagoblin# sudo -u mediagoblin bin/gmg --help
<agoblin.example.org/mediagoblin# sudo -u mediagoblin bin/gmg --help
usage: gmg [-h] [-cf CONF_FILE]
{batchaddmedia,shell,adduser,assetlink,makeadmin,reprocess,serve,deleteuser,addmedia,dbupdate,deletemedia,changepw}
...
GNU MediaGoblin utilities.
positional arguments:
{batchaddmedia,shell,adduser,assetlink,makeadmin,reprocess,serve,deleteuser,addmedia,dbupdate,deletemedia,changepw}
sub-command help
shell Run a shell with some tools pre-setup
adduser Creates an user
assetlink Link assets for themes and plugins for static serving
reprocess Reprocess media entries
serve PasteScript replacement
batchaddmedia Add many media entries at once
deletemedia Delete media entries
changepw Changes a user's password
deleteuser Deletes a user
dbupdate Set up or update the SQL database
makeadmin Makes user an admin
addmedia Reprocess media entries
optional arguments:
-h, --help show this help message and exit
-cf CONF_FILE, --conf_file CONF_FILE
Config file used to set up environment. Default to
mediagoblin_local.ini if readable, otherwise
mediagoblin.ini
root@441c517a3f31:/srv/mediagoblin.example.org/mediagoblin# sudo -u mediagoblin bin/gmg deleteuser --help
usage: gmg deleteuser [-h] username
positional arguments:
username Username to delete
optional arguments:
-h, --help show this help message and exit
root@441c517a3f31:/srv/mediagoblin.example.org/mediagoblin# sudo -u mediagoblin bin/gmg deleteuser loic
The user loic has been deleted
root@441c517a3f31:/srv/mediagoblin.example.org/mediagoblin#
The problem no longer exists in 0.8.1.

CC'ing tsyesika on this one as it's related to the API. I haven't confirmed the error though.