Introduces a four-tier role system: Regular User → Student Admin → Teacher Admin → Super Admin. Teacher Admin can manage own contests, problemsets, and view classroom data. Student Admin (renamed from Admin) retains problem management only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
719 B
Python
28 lines
719 B
Python
# Generated by Django 6.0.4 on 2026-06-03 00:08
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
def rename_admin_to_student_admin(apps, schema_editor):
|
|
User = apps.get_model("account", "User")
|
|
User.objects.filter(admin_type="Admin").update(admin_type="Student Admin")
|
|
|
|
|
|
def rename_student_admin_to_admin(apps, schema_editor):
|
|
User = apps.get_model("account", "User")
|
|
User.objects.filter(admin_type="Student Admin").update(admin_type="Admin")
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("account", "0006_alter_user_admin_type"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(
|
|
rename_admin_to_student_admin,
|
|
rename_student_admin_to_admin,
|
|
),
|
|
]
|