osmfj/sotmjp-website

追加講演者として、自分自身を登録できてしまう。

Closed this issue · 2 comments

登録できてしまうと、削除できない.
削除しようとすると

IntegrityError at /2015/admin/symposion_schedule/presentation/
update or delete on table "symposion_schedule_presentation" violates foreign key constraint "presentation_id_refs_id_ff9202bd" on table "symposion_schedule_presentation_additional_speakers"
DETAIL:  Key (id)=(1) is still referenced from table "symposion_schedule_presentation_additional_speakers".
Request Method: POST
Request URL:    http://staging.stateofthemap.jp/2015/admin/symposion_schedule/presentation/
Django Version: 1.7.8
Exception Type: IntegrityError
Exception Value:    
update or delete on table "symposion_schedule_presentation" violates foreign key constraint "presentation_id_refs_id_ff9202bd" on table "symposion_schedule_presentation_additional_speakers"
DETAIL:  Key (id)=(1) is still referenced from table "symposion_schedule_presentation_additional_speakers".
Exception Location: /srv/sites/sotmjp-website/env/sotmjp-website/local/lib/python2.7/site-packages/django/db/backends/__init__.py in _commit, line 145
Python Executable:  /srv/sites/sotmjp-website/env/sotmjp-website/bin/python
Python Version: 2.7.6
Python Path:    
['/srv/sites/sotmjp-website',
 '/srv/sites/sotmjp-website/env/sotmjp-website/bin',
 '/srv/sites/sotmjp-website/env/sotmjp-website/src/django-mailer',
 '/srv/sites/sotmjp-website/env/sotmjp-website/src/python-rtfng',
 '/srv/sites/sotmjp-website/env/sotmjp-website/src/restcms',
 '/srv/sites/sotmjp-website/env/sotmjp-website/src/django-admin-tabs',
 '/srv/sites/sotmjp-website/env/sotmjp-website/src/django-admin-tools',
 '/srv/sites/sotmjp-website/env/sotmjp-website/src/symposion',
 '/srv/sites/sotmjp-website/env/sotmjp-website/lib/python2.7',
 '/srv/sites/sotmjp-website/env/sotmjp-website/lib/python2.7/plat-x86_64-linux-gnu',
 '/srv/sites/sotmjp-website/env/sotmjp-website/lib/python2.7/lib-tk',
 '/srv/sites/sotmjp-website/env/sotmjp-website/lib/python2.7/lib-old',
 '/srv/sites/sotmjp-website/env/sotmjp-website/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/srv/sites/sotmjp-website/env/sotmjp-website/local/lib/python2.7/site-packages']
Server time:    土, 25 7月 2015 16:49:43 +0900

FORMではチェックが入っているが、Formの動作のレアケースで選択できてしまう可能性あり。
modelでもバリデーションを行うようにする。

Symposionに提案済みで、sotmjpブランチにマージ済みです