feat: Implement initial schema and add various API, service, and management command enhancements across the application.

This commit is contained in:
pacnpal
2026-01-01 15:13:01 -05:00
parent c95f99ca10
commit b243b17af7
413 changed files with 11164 additions and 17433 deletions

View File

@@ -7,10 +7,11 @@ sys.path.append(os.path.join(os.path.dirname(__file__)))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "thrillwiki.settings")
django.setup()
from django.contrib.auth import get_user_model
from django.contrib.auth import get_user_model # noqa: E402
User = get_user_model()
def ensure_admin():
username = "admin"
email = "admin@example.com"
@@ -23,12 +24,13 @@ def ensure_admin():
else:
print(f"Superuser {username} already exists.")
u = User.objects.get(username=username)
if not u.is_staff or not u.is_superuser or u.role != 'ADMIN':
if not u.is_staff or not u.is_superuser or u.role != "ADMIN":
u.is_staff = True
u.is_superuser = True
u.role = 'ADMIN'
u.role = "ADMIN"
u.save()
print("Updated existing user to ADMIN/Superuser.")
if __name__ == "__main__":
ensure_admin()