mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 20:18:38 +02:00
Remove load fixtures signal on migrate, add load command to docker compose, add DEBUG env check to load.py
This commit is contained in:
parent
7b8eee7b2f
commit
9ca424d30c
3 changed files with 10 additions and 15 deletions
|
@ -2,6 +2,7 @@ import logging
|
|||
|
||||
from django.core.management.base import BaseCommand
|
||||
from auditlog.context import disable_auditlog # type: ignore
|
||||
from django.conf import settings
|
||||
|
||||
from registrar.fixtures import UserFixture, DomainApplicationFixture, DomainFixture
|
||||
|
||||
|
@ -12,8 +13,11 @@ class Command(BaseCommand):
|
|||
def handle(self, *args, **options):
|
||||
# django-auditlog has some bugs with fixtures
|
||||
# https://github.com/jazzband/django-auditlog/issues/17
|
||||
with disable_auditlog():
|
||||
UserFixture.load()
|
||||
DomainApplicationFixture.load()
|
||||
DomainFixture.load()
|
||||
logger.info("All fixtures loaded.")
|
||||
if settings.DEBUG:
|
||||
with disable_auditlog():
|
||||
UserFixture.load()
|
||||
DomainApplicationFixture.load()
|
||||
DomainFixture.load()
|
||||
logger.info("All fixtures loaded.")
|
||||
else:
|
||||
logger.warn("Refusing to load fixture data in a non DEBUG env")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue