Skip to content

Commit

Permalink
Merge pull request #606 from znick/user_profile_cascade
Browse files Browse the repository at this point in the history
Delete user profile with user
  • Loading branch information
znick authored Apr 13, 2024
2 parents 1238f56 + 1787248 commit 42f090b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions anytask/users/migrations/0006_auto_20240413_0312.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 2.0.13 on 2024-04-13 00:12

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('users', '0005_merge_20220122_1951'),
]

operations = [
migrations.AlterField(
model_name='userprofile',
name='user',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL),
),
]
2 changes: 1 addition & 1 deletion anytask/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class UserProfile(models.Model):
blank=False,
unique=True,
related_name="profile",
on_delete=models.DO_NOTHING,
on_delete=models.CASCADE,
)
middle_name = models.CharField(max_length=128, db_index=True, null=True, blank=True)
user_status = models.ManyToManyField(UserStatus, db_index=True, blank=True, related_name='users_by_status')
Expand Down

0 comments on commit 42f090b

Please sign in to comment.