Move user/group setup into new generateSampleUserData command

This commit is contained in:
2021-02-04 15:44:07 +00:00
parent 6cb3d1855a
commit 462a16ec42
20 changed files with 300 additions and 253 deletions

View File

@@ -4,13 +4,14 @@ from django.contrib.auth.models import Group
from assets import models
from RIGS import models as rigsmodels
class Command(BaseCommand):
help = 'Deletes testing sample data'
def handle(self, *args, **kwargs):
from django.conf import settings
if not (settings.DEBUG):
if not settings.DEBUG:
raise CommandError('You cannot run this command in production')
self.delete_objects(models.AssetCategory)