Add initial migration for moderation app and resolve seed command issues

- Created an empty migration file for the moderation app to enable migrations.
- Documented the resolution of the seed command failure due to missing moderation tables.
- Identified and fixed a VARCHAR(10) constraint violation in the User model during seed data generation.
- Updated role assignment in the seed command to comply with the field length constraint.
This commit is contained in:
pacnpal
2025-09-25 08:39:05 -04:00
parent b1c369c1bb
commit 41b3c86437
13 changed files with 481 additions and 479 deletions

View File

@@ -31,7 +31,7 @@ class UserDeletionService:
"is_active": False,
"is_staff": False,
"is_superuser": False,
"role": User.Roles.USER,
"role": "USER",
"is_banned": True,
"ban_reason": "System placeholder for deleted users",
"ban_date": timezone.now(),
@@ -178,7 +178,7 @@ class UserDeletionService:
return False, "Superuser accounts cannot be deleted for security reasons. Please contact system administrator or remove superuser privileges first."
# Check if user has critical admin role
if user.role == User.Roles.ADMIN and user.is_staff:
if user.role == "ADMIN" and user.is_staff:
return False, "Admin accounts with staff privileges cannot be deleted. Please remove admin privileges first or contact system administrator."
# Add any other business rules here