Closed
Bug 912916
Opened 11 years ago
Closed 11 years ago
Bugs model behaviour on user delete
Categories
(Mozilla Reps Graveyard :: reps.mozilla.org, task)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: nemo-yiannis, Unassigned)
Details
(Whiteboard: [kb=1104911] [good first bug][lang=python])
"Bug" model class under remozilla app has two foreign keys (creator, assigned_to) to "User" class [1]. Django's default behaviour on delete object with foreign key dependencies is to delete the dependencies as well [2].
This causes problems in the way we define bugs. For example a user who has created or is assigned to a bug gets deleted. This also deletes the bugs that might be useful to another user in the portal. A solution to that could be to set the foreign key values to NULL [3]
[1] https://github.com/mozilla/remo/blob/master/remo/remozilla/models.py#L19
[2] https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.on_delete
[3] https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.SET_NULL
Reporter | ||
Updated•11 years ago
|
Group: mozilla-reps-admins
Reporter | ||
Updated•11 years ago
|
Whiteboard: [kb=1104911]
Reporter | ||
Updated•11 years ago
|
Whiteboard: [kb=1104911] → [kb=1104911] [good first bug][lang=python]
Reporter | ||
Comment 1•11 years ago
|
||
Correction:
"Bug" model class under remozilla app has two foreign keys (creator, assigned_to) to "User" class [1]. Django's default behaviour when you delete an object which is referenced by a foreign key is to delete the objects containing the foreign key as well [2].
Comment 2•11 years ago
|
||
Commit pushed to master at https://github.com/mozilla/remo
https://github.com/mozilla/remo/commit/8a7f25140dc5fbffe28c4d72fc42031687808a80
[fix bug 912916] Don't delete related bugs on user's delete.
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Version: unspecified → 413
Updated•4 years ago
|
Product: Mozilla Reps → Mozilla Reps Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•