Fix not allowing deletion of users due to RaidComment being PROTECTed instead of CASCADEd.
This commit is contained in:
parent
d937804737
commit
8012162b2b
21
drakul/raids/migrations/0006_auto_20200417_0854.py
Normal file
21
drakul/raids/migrations/0006_auto_20200417_0854.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# Generated by Django 3.0.2 on 2020-04-17 08:54
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('raids', '0005_auto_20200106_2305'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='raidcomment',
|
||||||
|
name='user',
|
||||||
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='raid_comments', to=settings.AUTH_USER_MODEL),
|
||||||
|
),
|
||||||
|
]
|
|
@ -141,7 +141,7 @@ class RaidComment(models.Model):
|
||||||
user = models.ForeignKey(
|
user = models.ForeignKey(
|
||||||
settings.AUTH_USER_MODEL,
|
settings.AUTH_USER_MODEL,
|
||||||
related_name="raid_comments",
|
related_name="raid_comments",
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.CASCADE,
|
||||||
)
|
)
|
||||||
|
|
||||||
body = models.TextField(
|
body = models.TextField(
|
||||||
|
|
Loading…
Reference in a new issue